mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 05:30:37 +01:00
* allow set type to be a generic parameter, resolves #40453
This commit is contained in:
parent
431e42c873
commit
a3f221e189
@ -1339,6 +1339,9 @@ implementation
|
||||
else
|
||||
Message(sym_e_ill_type_decl_set);
|
||||
end;
|
||||
{ generic parameter? }
|
||||
undefineddef:
|
||||
;
|
||||
else
|
||||
Message(sym_e_ill_type_decl_set);
|
||||
end;
|
||||
|
||||
19
tests/webtbs/tw40453.pp
Normal file
19
tests/webtbs/tw40453.pp
Normal file
@ -0,0 +1,19 @@
|
||||
program Project1;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
type
|
||||
TEnum = (A, B, C);
|
||||
|
||||
procedure Test<T>(E: T);
|
||||
type
|
||||
S1 = set of TEnum;
|
||||
S2 = set of Low(T)..High(T);
|
||||
S3 = set of T; //Error
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
Test<TEnum>(B);
|
||||
ReadLn;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user