fcl-passrc: test unitdot in constraint

git-svn-id: trunk@46663 -
This commit is contained in:
Mattias Gaertner 2020-08-23 14:13:06 +00:00
parent 050f1fa1f4
commit 0b6501fbfb

View File

@ -30,6 +30,7 @@ type
procedure TestGen_ConstraintRecordClassFail;
procedure TestGen_ConstraintArrayFail;
procedure TestGen_ConstraintConstructor;
procedure TestGen_ConstraintUnit;
// ToDo: constraint T:Unit2.TBird
// ToDo: constraint T:Unit2.TGen<word>
procedure TestGen_ConstraintSpecialize;
@ -379,6 +380,36 @@ begin
ParseProgram;
end;
procedure TTestResolveGenerics.TestGen_ConstraintUnit;
begin
AddModuleWithIntfImplSrc('unit1.pas',
LinesToStr([
'type',
' TBird = class b1: word; end;',
' generic TAnt<T> = class a1: T; end;',
'']),
LinesToStr([
'']));
StartProgram(true,[supTObject]);
Add([
'uses unit1;',
'type',
' generic TCat<T: unit1.TBird> = class v: T; end;',
' generic TFish<T: specialize TAnt<word>> = class v: T; end;',
' TEagle = class(unit1.TBird);',
' TRedAnt = specialize TAnt<word>;',
'var',
' eagle: TEagle;',
' redant: TRedAnt;',
' cat: specialize TCat<TEagle>;',
' fish: specialize TFish<TRedAnt>;',
'begin',
' cat.v:=eagle;',
' fish.v:=redant;',
'']);
ParseProgram;
end;
procedure TTestResolveGenerics.TestGen_ConstraintSpecialize;
begin
StartProgram(false);