Browse Source

* fix invalid typecast

git-svn-id: trunk@8432 -
peter 18 years ago
parent
commit
68245771cc
1 changed files with 15 additions and 15 deletions
  1. 15 15
      compiler/pdecsub.pas

+ 15 - 15
compiler/pdecsub.pas

@@ -730,22 +730,22 @@ implementation
               (ttypesym(srsym).typedef.typ=objectdef) then
             begin
               aclass:=tobjectdef(ttypesym(srsym).typedef);
-              aprocsym:=tprocsym(aclass.symtable.Find(sp));
-              { we solve this below }
-              if assigned(aprocsym) then
+              srsym:=tsym(aclass.symtable.Find(sp));
+              if assigned(srsym) then
                begin
-                 if aprocsym.typ<>procsym then
-                  begin
-                    {  we use a different error message for tp7 so it looks more compatible }
-                    if (m_fpc in current_settings.modeswitches) then
-                      Message1(parser_e_overloaded_no_procedure,aprocsym.realname)
-                    else
-                      Message(parser_e_methode_id_expected);
-                    { rename the name to an unique name to avoid an
-                      error when inserting the symbol in the symtable }
-                    orgsp:=orgsp+'$'+tostr(current_filepos.line);
-                    aprocsym:=nil;
-                  end;
+                 if srsym.typ=procsym then
+                   aprocsym:=tprocsym(srsym)
+                 else
+                   begin
+                     {  we use a different error message for tp7 so it looks more compatible }
+                     if (m_fpc in current_settings.modeswitches) then
+                       Message1(parser_e_overloaded_no_procedure,srsym.realname)
+                     else
+                       Message(parser_e_methode_id_expected);
+                     { rename the name to an unique name to avoid an
+                       error when inserting the symbol in the symtable }
+                     orgsp:=orgsp+'$'+tostr(current_filepos.line);
+                   end;
                end
               else
                begin