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

Paul Ishenin ip at kmiac.ru
Tue Feb 28 01:46:57 CET 2012


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
>
> A none existing function, reports an immediate error, on the line where
> the property is declared:
> property Foo: TObject read NoneExistingFunction;
>
> But
> 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?

Best regards,
Paul Ishenin





More information about the fpc-devel mailing list