Merge branch 'FixInheritedClass' into 'main'

Fix for inherited external class, with full path of the class.

See merge request freepascal.org/fpc/source!561
This commit is contained in:
Henrique Gottardi Werlang 2025-04-03 18:18:09 -03:00
commit e99a59bf09

View File

@ -16041,6 +16041,14 @@ var
end;
end;
function GetFullClassPath(const ClassType: TPasClassType): String;
begin
Result := ClassType.ExternalName;
if ClassType.Parent is TPasClassType then
Result := GetFullClassPath(TPasClassType(ClassType.Parent)) + '.' + Result;
end;
var
aResolver: TPas2JSResolver;
DelaySrc: TJSSourceElements;
@ -16154,7 +16162,7 @@ begin
if Ancestor=nil then
AncestorPath:='null'
else if AncestorIsExternal then
AncestorPath:=TPasClassType(Ancestor).ExternalName
AncestorPath:=GetFullClassPath(TPasClassType(Ancestor))
else
AncestorPath:=CreateReferencePath(Ancestor,AContext,rpkPathAndName);
Call.AddArg(CreatePrimitiveDotExpr(AncestorPath,El));