fpc/tests/tbs/tb0677.pp
svenbarth e6ad8a0dfa Merged revision(s) 44172, 44188, 45457 - 45458, 45645, 46218, 46953 from trunk:
r46953
* fix for Mantis #37806: allow undefineddefs for Include() and Exclude() + added tests
---------------------
r46218
* fix for Mantis #37187: inside generics the constant code in pexpr does not handle all cases and thus current_procinfo needs to be checked as well + added test
---------------------
r45645
* correctly set the generic related defoptions for an outlined procdef
---------------------
r45458
  * make more use of is_typeparam
---------------------
r45457
  * constrained type parameters are not undefined defs, resolves #37107
---------------------
r44188
* keep track of the fileposinfo for generic constraints
---------------------
r44172
* only resolve a dummy symbol if it is a type symbol (thus truly a dummy symbol) + added tests
---------------------

git-svn-id: branches/fixes_3_2@47802 -
2020-12-17 21:31:16 +00:00

41 lines
497 B
ObjectPascal

{ %NORUN }
program tb0677;
{$mode objfpc}
type
TEnum = (eOne, eTwo, eThree, eFour);
TSet = set of TEnum;
generic TTest<SetType, EnumType> = class
procedure Test;
end;
procedure TTest.Test;
var
s1: TSet;
s2: SetType;
e1: TEnum;
e2: EnumType;
begin
Include(s1, e1);
Exclude(s1, e1);
Include(s2, e1);
Exclude(s2, e1);
Include(s2, e2);
Exclude(s2, e2);
Include(s2, e1);
Exclude(s2, e2);
end;
type
TTestTypes = specialize TTest<TSet, TEnum>;
begin
end.