mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 13:39:08 +02:00
codetools: test generic function after type
git-svn-id: trunk@60478 -
This commit is contained in:
parent
801d5e137c
commit
bcd365ba77
@ -607,10 +607,18 @@ begin
|
||||
StartProgram;
|
||||
Add([
|
||||
'{$mode objfpc}',
|
||||
'type',
|
||||
' TBird = class',
|
||||
' generic class function Fly<T>(const AValues:array of T):T;',
|
||||
' end;',
|
||||
'generic function RandomFrom<T>(const AValues:array of T):T;',
|
||||
'begin',
|
||||
' Result:=Avalue[1];',
|
||||
'end;',
|
||||
'generic class function TBird.Fly<T>(const AValues:array of T):T;',
|
||||
'begin',
|
||||
' Result:=Avalue[1];',
|
||||
'end;',
|
||||
'begin',
|
||||
' i:=RandomFrom<longint>([1,2,3]);',
|
||||
'end.',
|
||||
|
Loading…
Reference in New Issue
Block a user