[fpc-devel] global property, with getter in other unit

Martin lazarus at mfriebe.de
Wed Feb 29 03:20:21 CET 2012


On 29/02/2012 01:40, Paul Ishenin wrote:
> 28.02.2012 9:11, Martin пишет:
>> Attached.
>>
>> It needed 3 units,
>>
>> accessing Foo in the same unit, in which it is declared (unit2) compiles
>> (not tested if it runs...)
>
> You found some bug in the compiler. Property can only be declared 
> inside a structure but compiler allowed to do this in a unit level.
>
> If this is not some FPC feature unknown to me I will fix it.
http://www.freepascal.org/docs-html/ref/refse24.html#x56-630004.6

questiion is about where the getterr/setter must be defined.

btw, they  can not be prefixed

this fails
    property FooSinteger read SomeUnit.GetFoo;

this passes, but fails from 3rd unit
    property FooSinteger read GetFooFromSomeUnit;



More information about the fpc-devel mailing list