[fpc-pascal] Assigning a result of a method reference

Joao Morais post at joaomorais.com.br
Sun Jun 24 17:20:22 CEST 2007


Michael Van Canneyt wrote:
> 
> On Sat, 23 Jun 2007, Joao Morais wrote:
> 
>> Michael Van Canneyt wrote:
>>> On Sat, 23 Jun 2007, Joao Morais wrote:
>>>
>>>>   Result := vmetadatamethod;
>>>> end;
>>>>
>>>> the last assignment doesn't compile, the compiler complains that:
>>>>
>>>> Error: Incompatible types: got "<procedure variable type of
>>>> function:AnsiString of object;Register>" expected "AnsiString"
>>> Try
>>>
>>>   Result := vmetadatamethod();
>>> Your code does not even compile under Delphi...
>> It compiles and works since (at least) D5 and under fpc's $mode delphi. In
>> this case, the need of the brackets under objfpc can be considered a bug?
>> Should I file a bug report?
> 
> No, it is normal in objfpc mode.

Don't get me wrong but... sure? Afaics the compiler doesn't need to see 
the brackets to understand what I mean, so this one sounds a C 
convention to me.

Thanks.
--
Joao Morais



More information about the fpc-pascal mailing list