[fpc-devel] The usage of Include() doesn't work any more in 2.3.1

Peter Vreman peter at freepascal.org
Wed Jul 16 12:53:35 CEST 2008


> On Wed, Jul 16, 2008 at 9:40 AM, Daniël Mantione
> <daniel.mantione at freepascal.org> wrote:
>> I think there can be two visions here:
>> - Include is not a real procedure, so this internal implementation detail
>>  should be hidden and this can/should be allowed; the
>>  compiler internally should convert it into set:=set+[member].
>
> I think this would be ideal.  Using Include() is much cleaner than set
> := set + [member].  And yes I understand that as it was implement, you
> could circumvent the getter/setter, but I believe it's something the
> compiler must handle correctly.
>
> It's easy for me (from a developers point of view <wink>) to say, but
> I think that it's up to the compiler to resolve the issue at hand.
> It's not the job of the developer to change all existing code.  Surely
> the compiler must be able to detect if set is a property or field
> variable. If it's a property, resolve the call to set := set +
> [member]
>
> As it stands now, FPC 2.3.1 is going to break a LOT of code. Yes I
> know it was maybe a unsafe way of using Include(), but surely the
> compiler can handle it better.  Thoughts?

At least the error message can be improved.

Additional we can maybe introduce a new switch and reduce the error to a warning in case the
property is a varaible only and not a procedure.


Peter




More information about the fpc-devel mailing list