فهرست منبع

* better error messages for invalid floating point and classrefdef
typed constant expressions (only say that the problem is incompatible
types when the types actually are incompatible)

git-svn-id: trunk@12532 -

Jonas Maebe 16 سال پیش
والد
کامیت
5c981f38ff
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      compiler/ptconst.pas

+ 6 - 2
compiler/ptconst.pas

@@ -288,8 +288,10 @@ implementation
             value:=trealconstnode(n).value_real
           else if is_constintnode(n) then
             value:=tordconstnode(n).value
+          else if is_constnode(n) then
+            IncompatibleTypes(n.resultdef, def)
           else
-            IncompatibleTypes(n.resultdef, def);
+            Message(parser_e_illegal_expression);
 
           case def.floattype of
              s32real :
@@ -330,8 +332,10 @@ implementation
               end;
              niln:
                list.concat(Tai_const.Create_sym(nil));
+             else if is_constnode(n) then
+               IncompatibleTypes(n.resultdef, def)
              else
-               IncompatibleTypes(n.resultdef, def);
+               Message(parser_e_illegal_expression);
           end;
           n.free;
         end;