Browse Source

* patches from Aleksa Todorovic for #15480 to improve error reporting, does not resolve #15480

git-svn-id: trunk@16287 -
florian 14 years ago
parent
commit
eb3644140a
6 changed files with 21 additions and 21 deletions
  1. 3 3
      compiler/htypechk.pas
  2. 6 6
      compiler/ncnv.pas
  3. 3 3
      compiler/nflw.pas
  4. 4 4
      compiler/ninl.pas
  5. 4 4
      compiler/pdecvar.pas
  6. 1 1
      compiler/ptype.pas

+ 3 - 3
compiler/htypechk.pas

@@ -502,7 +502,7 @@ implementation
         { stop when there are no operators found }
         if candidates.count=0 then
           begin
-            CGMessage2(parser_e_operator_not_overloaded_2,ld.gettypename,arraytokeninfo[optoken].str);
+            CGMessage2(parser_e_operator_not_overloaded_2,ld.typename,arraytokeninfo[optoken].str);
             candidates.free;
             ppn.free;
             t:=cnothingnode.create;
@@ -520,7 +520,7 @@ implementation
         { exit when no overloads are found }
         if cand_cnt=0 then
           begin
-            CGMessage2(parser_e_operator_not_overloaded_2,ld.gettypename,arraytokeninfo[optoken].str);
+            CGMessage2(parser_e_operator_not_overloaded_2,ld.typename,arraytokeninfo[optoken].str);
             candidates.free;
             ppn.free;
             t:=cnothingnode.create;
@@ -666,7 +666,7 @@ implementation
         { exit when no overloads are found }
         if cand_cnt=0 then
           begin
-            CGMessage3(parser_e_operator_not_overloaded_3,ld.gettypename,arraytokeninfo[optoken].str,rd.gettypename);
+            CGMessage3(parser_e_operator_not_overloaded_3,ld.typename,arraytokeninfo[optoken].str,rd.typename);
             candidates.free;
             ppn.free;
             t:=cnothingnode.create;

+ 6 - 6
compiler/ncnv.pas

@@ -731,11 +731,11 @@ implementation
             ((Torddef(node.resultdef).low>Torddef(def).low) or (Torddef(node.resultdef).high<Torddef(def).high)) then
            case node.nodetype of
              addn:
-               cgmessage1(type_h_convert_add_operands_to_prevent_overflow,def.gettypename);
+               cgmessage1(type_h_convert_add_operands_to_prevent_overflow,def.typename);
              subn:
-               cgmessage1(type_h_convert_sub_operands_to_prevent_overflow,def.gettypename);
+               cgmessage1(type_h_convert_sub_operands_to_prevent_overflow,def.typename);
              muln:
-               cgmessage1(type_h_convert_mul_operands_to_prevent_overflow,def.gettypename);
+               cgmessage1(type_h_convert_mul_operands_to_prevent_overflow,def.typename);
            end;
       end;
 
@@ -1308,7 +1308,7 @@ implementation
              result:=cordconstnode.create(fcc,u32inttype,false);
            end
          else
-           CGMessage2(type_e_illegal_type_conversion,left.resultdef.GetTypeName,resultdef.GetTypeName);
+           CGMessage2(type_e_illegal_type_conversion,left.resultdef.typename,resultdef.typename);
       end;
 
 
@@ -1880,7 +1880,7 @@ implementation
                          if assigned(hdef) then
                            inserttypeconv_internal(left,hdef)
                          else
-                           CGMessage2(type_e_illegal_type_conversion,left.resultdef.GetTypeName,resultdef.GetTypeName);
+                           CGMessage2(type_e_illegal_type_conversion,left.resultdef.typename,resultdef.typename);
                        end;
 
                      { check if the result could be in a register }
@@ -1976,7 +1976,7 @@ implementation
                                  (left.nodetype=derefn)
                                 )
                                ) then
-                           CGMessage2(type_e_illegal_type_conversion,left.resultdef.GetTypeName,resultdef.GetTypeName);
+                           CGMessage2(type_e_illegal_type_conversion,left.resultdef.typename,resultdef.typename);
                        end;
                    end
                   else

+ 3 - 3
compiler/nflw.pas

@@ -871,7 +871,7 @@ implementation
                         result:=cerrornode.create;
                         hloopvar.free;
                         hloopbody.free;
-                        MessagePos1(expr.fileinfo,sym_e_no_enumerator_move,pd.returndef.GetTypeName);
+                        MessagePos1(expr.fileinfo,sym_e_no_enumerator_move,pd.returndef.typename);
                       end
                     else
                       begin
@@ -881,7 +881,7 @@ implementation
                             result:=cerrornode.create;
                             hloopvar.free;
                             hloopbody.free;
-                            MessagePos1(expr.fileinfo,sym_e_no_enumerator_current,pd.returndef.GetTypeName);
+                            MessagePos1(expr.fileinfo,sym_e_no_enumerator_current,pd.returndef.typename);
                           end
                         else
                           result:=create_enumerator_for_in_loop(hloopvar, hloopbody, expr, pd, movenext, current);
@@ -898,7 +898,7 @@ implementation
                         result:=cerrornode.create;
                         hloopvar.free;
                         hloopbody.free;
-                        MessagePos1(expr.fileinfo,sym_e_no_enumerator,expr.resultdef.GetTypeName);
+                        MessagePos1(expr.fileinfo,sym_e_no_enumerator,expr.resultdef.typename);
                       end;
                     end;
                   end;

+ 4 - 4
compiler/ninl.pas

@@ -1958,13 +1958,13 @@ implementation
 
               { source must be a packed array }
               if not is_packed_array(source.left.resultdef) then
-                CGMessagePos2(source.left.fileinfo,type_e_got_expected_packed_array,'1',source.left.resultdef.GetTypeName)
+                CGMessagePos2(source.left.fileinfo,type_e_got_expected_packed_array,'1',source.left.resultdef.typename)
               else
                 packedarraydef := tarraydef(source.left.resultdef);
               { target can be any kind of array, as long as it's not packed }
               if (target.left.resultdef.typ <> arraydef) or
                  is_packed_array(target.left.resultdef) then
-                CGMessagePos2(target.left.fileinfo,type_e_got_expected_unpacked_array,'2',target.left.resultdef.GetTypeName)
+                CGMessagePos2(target.left.fileinfo,type_e_got_expected_unpacked_array,'2',target.left.resultdef.typename)
               else
                 unpackedarraydef := tarraydef(target.left.resultdef);
             end
@@ -1976,12 +1976,12 @@ implementation
               { source can be any kind of array, as long as it's not packed }
               if (source.left.resultdef.typ <> arraydef) or
                  is_packed_array(source.left.resultdef) then
-                CGMessagePos2(source.left.fileinfo,type_e_got_expected_unpacked_array,'1',source.left.resultdef.GetTypeName)
+                CGMessagePos2(source.left.fileinfo,type_e_got_expected_unpacked_array,'1',source.left.resultdef.typename)
               else
                 unpackedarraydef := tarraydef(source.left.resultdef);
               { target must be a packed array }
               if not is_packed_array(target.left.resultdef) then
-                CGMessagePos2(target.left.fileinfo,type_e_got_expected_packed_array,'3',target.left.resultdef.GetTypeName)
+                CGMessagePos2(target.left.fileinfo,type_e_got_expected_packed_array,'3',target.left.resultdef.typename)
               else
                 packedarraydef := tarraydef(target.left.resultdef);
             end;

+ 4 - 4
compiler/pdecvar.pas

@@ -731,7 +731,7 @@ implementation
                begin
                  if compare_defs(def,p.propdef,nothingn)<te_equal then
                    begin
-                     message2(parser_e_implements_must_have_correct_type,def.GetTypeName,p.propdef.GetTypeName);
+                     message2(parser_e_implements_must_have_correct_type,def.typename,p.propdef.typename);
                      exit;
                    end;
                end
@@ -742,13 +742,13 @@ implementation
                    begin
                      if compare_defs(ImplIntf.IntfDef,def,nothingn)<te_equal then
                        begin
-                         message2(parser_e_implements_must_have_correct_type,ImplIntf.IntfDef.GetTypeName,def.GetTypeName);
+                         message2(parser_e_implements_must_have_correct_type,ImplIntf.IntfDef.typename,def.typename);
                          exit;
                        end;
                    end
                  else
                    begin
-                     message2(parser_e_class_doesnt_implement_interface,p.propdef.GetTypeName,def.GetTypeName);
+                     message2(parser_e_class_doesnt_implement_interface,p.propdef.typename,def.typename);
                      exit;
                    end;
                end
@@ -819,7 +819,7 @@ implementation
                    end;
                end
              else
-               message1(parser_e_implements_uses_non_implemented_interface,def.GetTypeName);
+               message1(parser_e_implements_uses_non_implemented_interface,def.typename);
          end;
 
          { remove temporary procvardefs }

+ 1 - 1
compiler/ptype.pas

@@ -720,7 +720,7 @@ implementation
                        indexdef:=def;
                     end
                   else
-                    Message1(parser_e_type_cant_be_used_in_array_index,def.GetTypeName);
+                    Message1(parser_e_type_cant_be_used_in_array_index,def.typename);
                 end;
               else
                 Message(sym_e_error_in_type_def);