mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 21:00:28 +02:00
fcl-passrc: started test generic with type alias
This commit is contained in:
parent
ad637e8f09
commit
d8fa6e6a9c
@ -98,6 +98,7 @@ type
|
||||
procedure TestGen_Class_List;
|
||||
procedure TestGen_Class_Typecast;
|
||||
// ToDo: different modeswitches at parse time and specialize time
|
||||
procedure TestGen_Class_TypeAliasAssignFail; // todo
|
||||
|
||||
// generic external class
|
||||
procedure TestGen_ExtClass_Array;
|
||||
@ -1683,6 +1684,28 @@ begin
|
||||
// Delphi: no warning
|
||||
end;
|
||||
|
||||
procedure TTestResolveGenerics.TestGen_Class_TypeAliasAssignFail;
|
||||
begin
|
||||
exit;
|
||||
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'{$mode objfpc}',
|
||||
'type',
|
||||
' TDate = type double;',
|
||||
' TObject = class end;',
|
||||
' generic TBird<T> = class',
|
||||
' end;',
|
||||
'var',
|
||||
' a: specialize TBird<double>;',
|
||||
' b: specialize TBird<TDate>;',
|
||||
'begin',
|
||||
' a:=b;',
|
||||
'']);
|
||||
CheckResolverException('Incompatible types: got expected',
|
||||
nGenericsWithoutSpecializationAsType);
|
||||
end;
|
||||
|
||||
procedure TTestResolveGenerics.TestGen_ExtClass_Array;
|
||||
begin
|
||||
StartProgram(false);
|
||||
|
Loading…
Reference in New Issue
Block a user