mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 19:50:17 +02:00
fcl-passrc: starting test generics
git-svn-id: trunk@42252 -
This commit is contained in:
parent
fb29815fbf
commit
783505b4d7
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -2647,6 +2647,7 @@ packages/fcl-passrc/tests/tcmoduleparser.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tconstparser.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcpassrcutil.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcprocfunc.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcresolvegenerics.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcresolver.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcscanner.pas svneol=native#text/plain
|
||||
packages/fcl-passrc/tests/tcstatements.pas svneol=native#text/plain
|
||||
|
43
packages/fcl-passrc/tests/tcresolvegenerics.pas
Normal file
43
packages/fcl-passrc/tests/tcresolvegenerics.pas
Normal file
@ -0,0 +1,43 @@
|
||||
unit tcresolvegenerics;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, testregistry, tcresolver;
|
||||
|
||||
type
|
||||
|
||||
{ TTestResolveGenerics }
|
||||
|
||||
TTestResolveGenerics = Class(TCustomTestResolver)
|
||||
Published
|
||||
procedure TestGen_GenericFunction; // ToDo
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TTestResolveGenerics }
|
||||
|
||||
procedure TTestResolveGenerics.TestGen_GenericFunction;
|
||||
begin
|
||||
exit;
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'generic function DoIt<T>(a: T): T;',
|
||||
'begin',
|
||||
' Result:=a;',
|
||||
'end;',
|
||||
'var w: word;',
|
||||
'begin',
|
||||
' w:=DoIt<word>(3);',
|
||||
'']);
|
||||
ParseProgram;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTests([TTestResolveGenerics]);
|
||||
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user