* 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:
maciej-izak 2017-09-03 19:05:21 +00:00
parent b6824290fc
commit 8b5524ac3a
3 changed files with 29 additions and 1 deletions

1
.gitattributes vendored
View File

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

View File

@ -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
View 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.