fcl-passrc: fixed typecast TList<TBird> to TList<TEagle>

git-svn-id: trunk@47039 -
This commit is contained in:
Mattias Gaertner 2020-10-03 13:19:46 +00:00
parent fdd3d163ff
commit 18f5fab782
2 changed files with 12 additions and 5 deletions

View File

@ -29715,12 +29715,19 @@ function TPasResolver.CheckClassIsClass(SrcType, DestType: TPasType): integer;
i: Integer;
SrcParam, DestParam: TPasType;
SrcParamScope, DestParamScope: TPasGenericScope;
SrcSpecializedFromItem, DestSpecializedFromItem: TPRSpecializedItem;
begin
if SrcScope.SpecializedFromItem.GenericEl<>DestScope.SpecializedFromItem.GenericEl then
SrcSpecializedFromItem:=SrcScope.SpecializedFromItem;
DestSpecializedFromItem:=DestScope.SpecializedFromItem;
if SrcSpecializedFromItem=nil then
exit(false);
if DestSpecializedFromItem=nil then
exit(false);
if SrcSpecializedFromItem.GenericEl<>DestSpecializedFromItem.GenericEl then
exit(false);
// specialized from same generic -> check params
SrcParams:=SrcScope.SpecializedFromItem.Params;
DestParams:=DestScope.SpecializedFromItem.Params;
SrcParams:=SrcSpecializedFromItem.Params;
DestParams:=DestSpecializedFromItem.Params;
for i:=0 to length(SrcParams)-1 do
begin
SrcParam:=SrcParams[i];

View File

@ -1650,8 +1650,8 @@ begin
' B: TBird;',
' List: TList<TEagle>;',
'begin',
// ' List:=TList<Eagle>(B.Legs);',
// ' TList<Eagle>(B.Legs):=List;',
' List:=TList<TEagle>(B.Legs);',
' TList<TEagle>(B.Legs):=List;',
'',
'']);
ParseProgram;