mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 08:10:54 +01:00
compiler: don't allow to publish class properties + test
git-svn-id: trunk@14640 -
This commit is contained in:
parent
09fd52791a
commit
9513b50d26
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8900,6 +8900,7 @@ tests/test/tclass12b.pp svneol=native#text/pascal
|
||||
tests/test/tclass12c.pp svneol=native#text/pascal
|
||||
tests/test/tclass13.pp svneol=native#text/pascal
|
||||
tests/test/tclass14a.pp svneol=native#text/pascal
|
||||
tests/test/tclass14b.pp svneol=native#text/pascal
|
||||
tests/test/tclass2.pp svneol=native#text/plain
|
||||
tests/test/tclass3.pp svneol=native#text/plain
|
||||
tests/test/tclass4.pp svneol=native#text/plain
|
||||
|
||||
@ -423,7 +423,7 @@ implementation
|
||||
end;
|
||||
end;
|
||||
if ((p.visibility=vis_published) or is_dispinterface(aclass)) and
|
||||
not(p.propdef.is_publishable) then
|
||||
(not(p.propdef.is_publishable) or (sp_static in p.symoptions)) then
|
||||
begin
|
||||
Message(parser_e_cant_publish_that_property);
|
||||
p.visibility:=vis_public;
|
||||
|
||||
19
tests/test/tclass14b.pp
Normal file
19
tests/test/tclass14b.pp
Normal file
@ -0,0 +1,19 @@
|
||||
{ %FAIL}
|
||||
program tclass14b;
|
||||
|
||||
{$ifdef fpc}
|
||||
{$mode delphi}{$H+}
|
||||
{$endif}
|
||||
|
||||
type
|
||||
TSomeClass = class
|
||||
public
|
||||
class var
|
||||
FSomeField: Integer;
|
||||
published
|
||||
// class properties are not for sreaming therefore publishing them is not supported
|
||||
class property SomeField: Integer read FSomeField write FSomeField;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user