瀏覽代碼

* in case there hasn't been an error generated with an invalid attribute declaration then print at least "illegal expression" error

Sven/Sarah Barth 2 年之前
父節點
當前提交
c7776d899b
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      compiler/pdecl.pas

+ 7 - 1
compiler/pdecl.pas

@@ -460,6 +460,7 @@ implementation
 
       var
         p,paran,pcalln,ptmp : tnode;
+        ecnt : longint;
         i,pcount : sizeint;
         paras : array of tnode;
         od : tobjectdef;
@@ -494,6 +495,7 @@ implementation
 
               pcalln:=ccallnode.create(paran,tprocsym(constrsym),od.symtable,cloadvmtaddrnode.create(p),[],nil);
               p:=nil;
+              ecnt:=errorcount;
               typecheckpass(pcalln);
 
               if (pcalln.nodetype=calln) and assigned(tcallnode(pcalln).procdefinition) and not codegenerror then
@@ -555,8 +557,12 @@ implementation
                         paras[i].free;
                     end;
                 end
-              else
+              else begin
+                { provide *some* error in case there hasn't been one }
+                if errorcount=ecnt then
+                  message(parser_e_illegal_expression);
                 pcalln.free;
+              end;
             end
           else
             begin