Explorar o código

* Fix special case of specialization function call

Michaël Van Canneyt hai 1 semana
pai
achega
8cd5c3a793

+ 8 - 1
packages/fcl-passrc/src/pparser.pp

@@ -2745,7 +2745,14 @@ begin
     tkBraceOpen:
       begin
       NextToken;
-      Last:=DoParseExpression(AParent);
+      // handle specializations like this: TA.X<B>()
+      if CurToken=tkBraceClose then
+        begin
+        Params:=TParamsExpr.Create( aParent,pekFuncParams);
+        Last:=Params;
+        end
+      else
+        Last:=DoParseExpression(AParent);
       if not Assigned(Last) then
         ParseExcSyntaxError;
       if (CurToken<>tkBraceClose) then

+ 6 - 1
packages/fcl-passrc/tests/tcexprparser.pas

@@ -154,7 +154,7 @@ type
     Procedure TestExpCaret;
     Procedure TestArrayAccess;
     Procedure TestHelperOnLiteral;
-
+    procedure TestSpecializedCall;
     procedure TestParseAdhocExpression;
   end;
 
@@ -700,6 +700,11 @@ begin
   ParseModule;
 end;
 
+procedure TTestExpressions.TestSpecializedCall;
+begin
+  ParseExpression('TA.Resolve<IB>()');
+end;
+
 
 procedure TTestExpressions.TestUnaryMinus;
 begin