codetools: added test for mode delphi generic proc inside normal record

git-svn-id: trunk@56507 -
This commit is contained in:
mattias 2017-11-27 15:00:54 +00:00
parent c43215a213
commit 37c6ae0b00
3 changed files with 20 additions and 4 deletions

View File

@ -649,14 +649,14 @@ begin
' integer = longint;',
' TOwnedCollection = class',
' end;',
' generic TTMSFNCOwnedCollection<T: class> = class(TOwnedCollection)',
' generic TMyOwnedCollection<T: class> = class(TOwnedCollection)',
' public type',
' TEnumerator = class',
' private',
' FIndex: Integer;',
' FCol: specialize TTMSFNCOwnedCollection<T>;',
' FCol: specialize TMyOwnedCollection<T>;',
' public',
' constructor Create(ACol: specialize TTMSFNCOwnedCollection<T>);',
' constructor Create(ACol: specialize TMyOwnedCollection<T>);',
' function GetCurrent: T;',
' function MoveNext: Boolean;',
' property Current: T read GetCurrent;',

View File

@ -93,7 +93,6 @@ var
SrcMark: TFDMarker;
CursorPos: TCodeXYPosition;
CodeContexts: TCodeContextInfo;
i: Integer;
begin
StartProgram;
Add([

View File

@ -42,6 +42,7 @@ type
procedure TestAtomRing;
procedure TestRecord_ClassOperators;
procedure TestDeprecated;
procedure TestParseGenericsDelphi;
end;
implementation
@ -333,6 +334,22 @@ begin
ParseModule;
end;
procedure TTestPascalParser.TestParseGenericsDelphi;
begin
StartProgram;
Add([
'{$mode delphi}',
'type',
' TRec = record',
' procedure Proc<T>;', // generic proc inside normal record
' end;',
'procedure TRec.Proc<T>;',
'begin',
'end;',
'begin']);
ParseModule;
end;
initialization
RegisterTest(TTestPascalParser);