Forráskód Böngészése

* 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 -

Jonas Maebe 11 éve
szülő
commit
159a35da4e

+ 1 - 1
.gitattributes

@@ -12753,6 +12753,7 @@ tests/webtbf/tw25915.pp svneol=native#text/pascal
 tests/webtbf/tw25951.pp svneol=native#text/pascal
 tests/webtbf/tw25951.pp svneol=native#text/pascal
 tests/webtbf/tw26176.pp svneol=native#text/pascal
 tests/webtbf/tw26176.pp svneol=native#text/pascal
 tests/webtbf/tw26193.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/tw2657.pp svneol=native#text/plain
 tests/webtbf/tw2670.pp svneol=native#text/plain
 tests/webtbf/tw2670.pp svneol=native#text/plain
 tests/webtbf/tw2719.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/tw2645.pp svneol=native#text/plain
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw2649.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/tw2651.pp svneol=native#text/plain
 tests/webtbs/tw2656.pp svneol=native#text/plain
 tests/webtbs/tw2656.pp svneol=native#text/plain
 tests/webtbs/tw2659.pp svneol=native#text/plain
 tests/webtbs/tw2659.pp svneol=native#text/plain

+ 11 - 1
compiler/pdecvar.pas

@@ -335,7 +335,8 @@ implementation
          paranr : word;
          paranr : word;
          i      : longint;
          i      : longint;
          ImplIntf     : TImplementedInterface;
          ImplIntf     : TImplementedInterface;
-         found        : boolean;
+         found,
+         gotreadorwrite: boolean;
          hreadparavs,
          hreadparavs,
          hparavs      : tparavarsym;
          hparavs      : tparavarsym;
          storedprocdef: tprocvardef;
          storedprocdef: tprocvardef;
@@ -509,9 +510,11 @@ implementation
 
 
          if not(is_dispinterface(astruct)) then
          if not(is_dispinterface(astruct)) then
            begin
            begin
+             gotreadorwrite:=false;
              { parse accessors }
              { parse accessors }
              if try_to_consume(_READ) then
              if try_to_consume(_READ) then
                begin
                begin
+                 gotreadorwrite:=true;
                  p.propaccesslist[palt_read].clear;
                  p.propaccesslist[palt_read].clear;
                  if parse_symlist(p.propaccesslist[palt_read],def) then
                  if parse_symlist(p.propaccesslist[palt_read],def) then
                   begin
                   begin
@@ -530,6 +533,7 @@ implementation
                p.inherit_accessor(palt_read);
                p.inherit_accessor(palt_read);
              if try_to_consume(_WRITE) then
              if try_to_consume(_WRITE) then
                begin
                begin
+                 gotreadorwrite:=true;
                  p.propaccesslist[palt_write].clear;
                  p.propaccesslist[palt_write].clear;
                  if parse_symlist(p.propaccesslist[palt_write],def) then
                  if parse_symlist(p.propaccesslist[palt_write],def) then
                   begin
                   begin
@@ -550,6 +554,12 @@ implementation
                end
                end
              else
              else
                p.inherit_accessor(palt_write);
                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
            end
          else
          else
            parse_dispinterface(p,readprocdef,writeprocdef,paranr);
            parse_dispinterface(p,readprocdef,writeprocdef,paranr);

+ 1 - 1
packages/fcl-db/src/memds/memds.pp

@@ -150,7 +150,7 @@ type
 
 
     Property FileModified : Boolean Read FFileModified;
     Property FileModified : Boolean Read FFileModified;
     // TMemDataset does not implement Filter. Please use OnFilter instead.
     // TMemDataset does not implement Filter. Please use OnFilter instead.
-    Property Filter: string; unimplemented;
+    Property Filter; unimplemented;
 
 
   published
   published
     Property FileName : String Read FFileName Write FFileName;
     Property FileName : String Read FFileName Write FFileName;

+ 1 - 1
packages/fcl-extra/src/daemonapp.pp

@@ -133,7 +133,7 @@ Type
     Property Daemon : TCustomDaemon Read FDaemon;
     Property Daemon : TCustomDaemon Read FDaemon;
     Property Params : TStrings Read FParams;
     Property Params : TStrings Read FParams;
     Property LastStatus : TCurrentStatus Read FLastStatus;
     Property LastStatus : TCurrentStatus Read FLastStatus;
-    Property CheckPoint : DWord;
+    Property CheckPoint : DWord read FCheckPoint;
   end;
   end;
   
   
   TDaemonClass = Class of TDaemon;
   TDaemonClass = Class of TDaemon;

+ 5 - 0
tests/webtbs/tw2650.pp → 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 }
 { Source provided for Free Pascal Bug Report 2650 }
 { Submitted by "marcov" on  2003-08-21 }
 { Submitted by "marcov" on  2003-08-21 }
 { e-mail: [email protected] }
 { e-mail: [email protected] }