[fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)
Michael Van Canneyt
michael at freepascal.org
Tue Feb 23 12:21:26 CET 2016
On Tue, 23 Feb 2016, Serguei TARASSOV wrote:
> Michael Van Canneyt wrote
>> The problem is in your code and the use of WITH, as I surmised in my
>> previous mail.
>>
>> In 2.6.4, FieldDef is resolved to the LOCAL VARIABLE FieldDef.
>> The code compiles ok.
>>
>> In 3.0.0, FieldDef is a NEW READ-ONLY property in TField.
>> Because of the WITH, the compiler resolves FieldDef to this property, but
>> it
>> is read-only, an so it gives an error.
>
> I see, but *it's not my code*, its a code of the big third-party framework
> that is working well with all version of Delphi/C++ builder and Lazarus 1.x
> with FPC 2.6.4.
> You cannot recommend them to change code.
If course I can, I just did.
> The mode Delphi is declared.
The mode is entirely irrelevant.
> It should be compatible.
We introduced the FieldDef property in TField.
This was a conscious decision.
They chose to use "with", and then this kind of thing can happen at any point.
So, they must adapt their code. Don't use "with" if you're not prepared to deal with such issues.
Michael.
More information about the fpc-pascal
mailing list