fpc/tests/webtbs/tw21593.pp
florian 79a77ae7d6 + in_generic for testing if currently a generic declaration/definition is parsed/record
* omit several error messages when in_generic is true because the error can be checked only during specialisation, resolves the issue reported in #21592

git-svn-id: trunk@20699 -
2012-04-03 19:29:09 +00:00

24 lines
398 B
ObjectPascal

{$MODE DELPHI}
type
TWrapper<T> = record
strict private
const Size1 = SizeOf(T); { Error: Illegal expression }
class procedure Test; static;
end;
class procedure TWrapper<T>.Test;
const
Size2 = SizeOf(T); { Error: Illegal expression }
var
size3: SizeInt = SizeOf(T); { Error: Illegal expression }
begin
Writeln(Size3);
end;
var
Wrapper : TWrapper<Byte>;
begin
end.