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

Martin lazarus at mfriebe.de
Tue Feb 28 02:11:31 CET 2012


On 28/02/2012 00:46, Paul Ishenin wrote:
> 28.02.2012 3:01, Martin пишет:
>> Defining a property in the interface section (outside a class), that
>> refers to methods in another unit, gives an *unexpected* error. It may
>> well be not allowed and then should give an error, but the right error
>> in the right place.
>>
>> Btw, only tested with 2.4.4, apologies if that is fixed in 2.6.0
verified with 2.6 too
>>
>> property Foo: TObject read FunctionFromOtherUnit; // OtherUnit is in 
>> uses
>>
>> The compiler passes that line without error.
>>
>> But when trying to read the property
>> UnitFoo.pas(999,3) Error: Wrong number of parameters specified for call
>> to "FunctionFromOtherUnit"
>
> Can you submit a more complete example?

Attached.

It needed 3 units,

accessing Foo in the same unit, in which it is declared (unit2) compiles 
(not tested if it runs...)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: New Folder.rar
Type: application/octet-stream
Size: 521 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20120228/e611566b/attachment.obj>


More information about the fpc-devel mailing list