pastojs: fixed using type alias

git-svn-id: trunk@37399 -
This commit is contained in:
Mattias Gaertner 2017-10-05 13:22:55 +00:00
parent a8fed34f99
commit 204ef5ac01
2 changed files with 5 additions and 0 deletions

View File

@ -12660,6 +12660,8 @@ begin
Result:=ComputeConstString(TPasProcedure(El).LibrarySymbolName,AContext,true)
else if (El is TPasVariable) and (TPasVariable(El).ExportName<>nil) then
Result:=ComputeConstString(TPasVariable(El).ExportName,AContext,true)
else if (El is TPasType) then
Result:=TransformVariableName(El,AContext.Resolver.ResolveAliasType(TPasType(El)).Name,AContext)
else
Result:=TransformVariableName(El,El.Name,AContext);
end;

View File

@ -6473,6 +6473,7 @@ begin
Add(' constructor Create;');
Add(' destructor Destroy;');
Add(' end;');
Add(' TBird = TObject;');
Add('constructor tobject.create;');
Add('begin end;');
Add('destructor tobject.destroy;');
@ -6480,6 +6481,7 @@ begin
Add('var Obj: tobject;');
Add('begin');
Add(' obj:=tobject.create;');
Add(' obj:=tbird.create;');
Add(' obj.destroy;');
ConvertProgram;
CheckSource('TestClass_TObjectDefaultConstructor',
@ -6498,6 +6500,7 @@ begin
]),
LinesToStr([ // $mod.$main
'$mod.Obj = $mod.TObject.$create("Create");',
'$mod.Obj = $mod.TObject.$create("Create");',
'$mod.Obj.$destroy("Destroy");',
'']));
end;