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.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to