mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 11:08:02 +02:00

- Remove unneeded check for "parse_generic" (it's already checked in the outer if-clause). + Check whether we are trying to specialize one of the surrounding type declarations of a nested type (as long as nested generics are forbidden this is always the outermost generic or specialization). This check can not rely on the symbol, because while parsing the generic or the specialization the symbol's def is still an errordef. This fixes Mantis #19498 . + Added test from bug report. git-svn-id: trunk@20247 -
28 lines
394 B
Plaintext
28 lines
394 B
Plaintext
{ %NORUN }
|
|
|
|
{$MODE OBJFPC} { -*- text -*- }
|
|
program tw19498;
|
|
|
|
type
|
|
generic TFoo1 <T> = class
|
|
type
|
|
TFoo2 = class
|
|
constructor Create(Owner: specialize TFoo1<T>);
|
|
end;
|
|
end;
|
|
|
|
constructor TFoo1.TFoo2.Create(Owner: specialize TFoo1<T>);
|
|
begin
|
|
end;
|
|
|
|
type
|
|
TIntegerFoo1 = specialize TFoo1<Integer>;
|
|
|
|
var
|
|
Foo1: TIntegerFoo1;
|
|
Foo2: TIntegerFoo1.TFoo2;
|
|
|
|
begin
|
|
end.
|
|
|