pastojs: fixed TExt(TExt.new)

This commit is contained in:
mattias 2019-04-05 10:51:11 +00:00
parent 48cc8cdc77
commit a86857dd15
2 changed files with 3 additions and 1 deletions

View File

@ -7556,7 +7556,7 @@ begin
else if aResolver.IsExternalClassConstructor(RightRefDecl) then
begin
// e.g. mod.ExtClass.new;
if El.Parent is TParamsExpr then
if (El.Parent is TParamsExpr) and (TParamsExpr(El.Parent).Value=El) then
// Note: ExtClass.new() is handled in ConvertFuncParams
RaiseNotSupported(El,AContext,20190116135818);
Result:=ConvertExternalConstructor(El.left,RightRef,nil,AContext);

View File

@ -15757,6 +15757,7 @@ begin
Add(' A: texta;');
Add('begin');
Add(' a:=texta.new;');
Add(' a:=texta(texta.new);');
Add(' a:=texta.new();');
Add(' a:=texta.new(1);');
Add(' with texta do begin');
@ -15775,6 +15776,7 @@ begin
LinesToStr([ // $mod.$main
'$mod.A = new ExtA();',
'$mod.A = new ExtA();',
'$mod.A = new ExtA();',
'$mod.A = new ExtA(1,2);',
'$mod.A = new ExtA();',
'$mod.A = new ExtA();',