mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 14:06:57 +02:00
* ignore is_publishable for properties in interfaces (related to $M+ directive). $M has effect on visibility of default section for classes. Interface has always only public section (fix for problem in tb0631.pp)
git-svn-id: trunk@37136 -
This commit is contained in:
parent
b6824290fc
commit
8b5524ac3a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11384,6 +11384,7 @@ tests/tbs/tb0627b.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0628.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0629.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0630.pp svneol=native#text/pascal
|
||||
tests/tbs/tb0631.pp svneol=native#text/pascal
|
||||
tests/tbs/tb205.pp svneol=native#text/plain
|
||||
tests/tbs/tb610.pp svneol=native#text/pascal
|
||||
tests/tbs/tb613.pp svneol=native#text/plain
|
||||
|
@ -498,8 +498,12 @@ implementation
|
||||
message(parser_e_no_property_found_to_override);
|
||||
end;
|
||||
end;
|
||||
{ ignore is_publishable for interfaces (related to $M+ directive).
|
||||
$M has effect on visibility of default section for classes.
|
||||
Interface has always only public section (fix for problem in tb0631.pp) }
|
||||
if ((p.visibility=vis_published) or is_dispinterface(astruct)) and
|
||||
(not(p.propdef.is_publishable) or (sp_static in p.symoptions)) then
|
||||
((not(p.propdef.is_publishable) and not is_interface(astruct)) or
|
||||
(sp_static in p.symoptions)) then
|
||||
begin
|
||||
Message(parser_e_cant_publish_that_property);
|
||||
p.visibility:=vis_public;
|
||||
|
23
tests/tbs/tb0631.pp
Normal file
23
tests/tbs/tb0631.pp
Normal file
@ -0,0 +1,23 @@
|
||||
program tb0631;
|
||||
|
||||
{$MODE DELPHI}
|
||||
|
||||
uses
|
||||
typinfo;
|
||||
|
||||
type
|
||||
{$M+}
|
||||
IFoo = interface
|
||||
['{6AE439A1-06AA-460A-9CEB-71A1FD1BCFFB}']
|
||||
procedure SetFoo(a: pointer);
|
||||
property Foo: pointer write SetFoo;
|
||||
end;
|
||||
|
||||
begin
|
||||
if PInterfaceData(TypInfo.GetTypeData(TypeInfo(IFoo)))^.PropertyTable^.Prop[0]^.PropType
|
||||
<> TypeInfo(Pointer)
|
||||
then
|
||||
halt(1);
|
||||
WriteLn('ok');
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user