From 68245771cc9cc2b77518b79e41a67d7c97f91845 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 11 Sep 2007 22:13:31 +0000 Subject: [PATCH] * fix invalid typecast git-svn-id: trunk@8432 - --- compiler/pdecsub.pas | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index 70b5ee224d..698cc9f407 100644 --- a/compiler/pdecsub.pas +++ b/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