From e9214c1826e4bd64e918210a30d644af3580a901 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 15 Jan 2010 15:49:34 +0000 Subject: [PATCH] compiler: improve comparison for property and getter. it was possible to declare a class property with regular method for the getter because of cpo_ignorehidden flag git-svn-id: trunk@14650 - --- compiler/pdecvar.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas index f733f0f7aa..50578f62c8 100644 --- a/compiler/pdecvar.pas +++ b/compiler/pdecvar.pas @@ -449,7 +449,9 @@ implementation non default calling conventions which might change the hidden stuff; see tw3216.pp (FK) } p.propaccesslist[palt_read].procdef:=Tprocsym(sym).Find_procdef_bypara(readprocdef.paras,p.propdef,[cpo_allowdefaults,cpo_ignorehidden]); - if not assigned(p.propaccesslist[palt_read].procdef) then + if not assigned(p.propaccesslist[palt_read].procdef) or + { because of cpo_ignorehidden we need to compare if it is a static class method and we have a class property } + ((sp_static in p.symoptions) <> ([po_classmethod,po_staticmethod]<=tprocdef(p.propaccesslist[palt_read].procdef).procoptions)) then Message(parser_e_ill_property_access_sym); end; fieldvarsym :