From eb2dc7a6745c611e9121677a90edb72c2630dca7 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 16 Sep 2009 18:40:15 +0000 Subject: [PATCH] * set type of self for obj-c instance methods to the type of the class instead of to ID (gcc-compatible) git-svn-id: branches/objc@13722 - --- compiler/pdecsub.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index 36ddcf5ce5..ca93283674 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -178,7 +178,13 @@ implementation include(aliasvs.varoptions,vo_is_msgsel); tlocalsymtable(tprocdef(pd).localst).insert(aliasvs); - vs:=tparavarsym.create('$self',paranr_objc_self,vs_value,objc_idtype,[vo_is_self,vo_is_hidden_para]); + if (po_classmethod in pd.procoptions) then + { compatible with what gcc does } + hdef:=objc_idtype + else + hdef:=tprocdef(pd)._class; + + vs:=tparavarsym.create('$self',paranr_objc_self,vs_value,hdef,[vo_is_self,vo_is_hidden_para]); pd.parast.insert(vs); end else if (pd.typ=procvardef) and