From 159a35da4ea1047485f3b39df6fdef69f0699636 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 15 Jun 2014 10:59:47 +0000 Subject: [PATCH] * check for read/write after a newly declared property (mantis #26011) o this reverts the support that was added for such declarations when mantis #4676 was fixed, but this was done for Delphi compatibility and a) current Delphi versions don't accept such declarations anymore either b) such declarations are meaningless o fixed a number of such invalid property declarations in packages git-svn-id: trunk@27966 - --- .gitattributes | 2 +- compiler/pdecvar.pas | 12 +++++++++++- packages/fcl-db/src/memds/memds.pp | 2 +- packages/fcl-extra/src/daemonapp.pp | 2 +- tests/{webtbs => webtbf}/tw2650.pp | 5 +++++ 5 files changed, 19 insertions(+), 4 deletions(-) rename tests/{webtbs => webtbf}/tw2650.pp (71%) diff --git a/.gitattributes b/.gitattributes index c4db6b0968..4779652538 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12753,6 +12753,7 @@ tests/webtbf/tw25915.pp svneol=native#text/pascal tests/webtbf/tw25951.pp svneol=native#text/pascal tests/webtbf/tw26176.pp svneol=native#text/pascal tests/webtbf/tw26193.pp svneol=native#text/pascal +tests/webtbf/tw2650.pp svneol=native#text/plain tests/webtbf/tw2657.pp svneol=native#text/plain tests/webtbf/tw2670.pp svneol=native#text/plain tests/webtbf/tw2719.pp svneol=native#text/plain @@ -13971,7 +13972,6 @@ tests/webtbs/tw2643.pp svneol=native#text/plain tests/webtbs/tw2645.pp svneol=native#text/plain tests/webtbs/tw2647.pp svneol=native#text/plain tests/webtbs/tw2649.pp svneol=native#text/plain -tests/webtbs/tw2650.pp svneol=native#text/plain tests/webtbs/tw2651.pp svneol=native#text/plain tests/webtbs/tw2656.pp svneol=native#text/plain tests/webtbs/tw2659.pp svneol=native#text/plain diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas index 4d8b9df2f8..7b814cec49 100644 --- a/compiler/pdecvar.pas +++ b/compiler/pdecvar.pas @@ -335,7 +335,8 @@ implementation paranr : word; i : longint; ImplIntf : TImplementedInterface; - found : boolean; + found, + gotreadorwrite: boolean; hreadparavs, hparavs : tparavarsym; storedprocdef: tprocvardef; @@ -509,9 +510,11 @@ implementation if not(is_dispinterface(astruct)) then begin + gotreadorwrite:=false; { parse accessors } if try_to_consume(_READ) then begin + gotreadorwrite:=true; p.propaccesslist[palt_read].clear; if parse_symlist(p.propaccesslist[palt_read],def) then begin @@ -530,6 +533,7 @@ implementation p.inherit_accessor(palt_read); if try_to_consume(_WRITE) then begin + gotreadorwrite:=true; p.propaccesslist[palt_write].clear; if parse_symlist(p.propaccesslist[palt_write],def) then begin @@ -550,6 +554,12 @@ implementation end else p.inherit_accessor(palt_write); + { a new property (needs to declare a getter or setter, except in + an interface } + if not(ppo_overrides in p.propoptions) and + not is_interface(astruct) and + not gotreadorwrite then + Consume(_READ); end else parse_dispinterface(p,readprocdef,writeprocdef,paranr); diff --git a/packages/fcl-db/src/memds/memds.pp b/packages/fcl-db/src/memds/memds.pp index d4e801661a..0d9912fea3 100644 --- a/packages/fcl-db/src/memds/memds.pp +++ b/packages/fcl-db/src/memds/memds.pp @@ -150,7 +150,7 @@ type Property FileModified : Boolean Read FFileModified; // TMemDataset does not implement Filter. Please use OnFilter instead. - Property Filter: string; unimplemented; + Property Filter; unimplemented; published Property FileName : String Read FFileName Write FFileName; diff --git a/packages/fcl-extra/src/daemonapp.pp b/packages/fcl-extra/src/daemonapp.pp index fd9ce94b0a..2097b17021 100644 --- a/packages/fcl-extra/src/daemonapp.pp +++ b/packages/fcl-extra/src/daemonapp.pp @@ -133,7 +133,7 @@ Type Property Daemon : TCustomDaemon Read FDaemon; Property Params : TStrings Read FParams; Property LastStatus : TCurrentStatus Read FLastStatus; - Property CheckPoint : DWord; + Property CheckPoint : DWord read FCheckPoint; end; TDaemonClass = Class of TDaemon; diff --git a/tests/webtbs/tw2650.pp b/tests/webtbf/tw2650.pp similarity index 71% rename from tests/webtbs/tw2650.pp rename to tests/webtbf/tw2650.pp index 57e8459df9..fbcf176c2d 100644 --- a/tests/webtbs/tw2650.pp +++ b/tests/webtbf/tw2650.pp @@ -1,3 +1,8 @@ +{ %fail } + +{ no longer supported by current Delphi versions and doesn't mean anything + anyway } + { Source provided for Free Pascal Bug Report 2650 } { Submitted by "marcov" on 2003-08-21 } { e-mail: marco@freepascal.org }