mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 02:28:14 +02:00

When parsing an inline specialization inside a generic we need to respect the "parsedtype" parameter which tells us whether the first generic parameter was already parsed. This fixes Mantis #20871 . + added test for this git-svn-id: trunk@20251 -
39 lines
683 B
ObjectPascal
39 lines
683 B
ObjectPascal
{ %NORUN }
|
|
|
|
program tw20871;
|
|
{$MODE delphi}
|
|
{$DEFINE CAUSE_ERROR}
|
|
|
|
type
|
|
TInterior<TValue> = class end;
|
|
|
|
TExterior<TValue> = class
|
|
strict private
|
|
FInterior: TInterior<TValue>;
|
|
public
|
|
constructor Create;
|
|
destructor Destroy; override;
|
|
end;
|
|
|
|
constructor TExterior<TValue>.Create;
|
|
{$IFDEF CAUSE_ERROR}
|
|
begin
|
|
FInterior := TInterior<TValue>.Create;
|
|
{ ^ Compiler reports here that “<” is expected }
|
|
{$ELSE}
|
|
type
|
|
TSpecializedInterior = TInterior<TValue>;
|
|
begin
|
|
FInterior := TSpecializedInterior.Create;
|
|
{$ENDIF}
|
|
end;
|
|
|
|
destructor TExterior<TValue>.Destroy;
|
|
begin
|
|
FInterior.Free;
|
|
end;
|
|
|
|
begin
|
|
TExterior<Integer>.Create.Free;
|
|
end.
|