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

Martin lazarus at mfriebe.de
Mon Feb 27 20:01:42 CET 2012


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"




More information about the fpc-devel mailing list