Op Wed, 16 Jul 2008, schreef Graeme Geldenhuys:

It compiles without issues under FPC 2.2.3 and prior.  What is wrong
with using Include() to add to a set?  I do it all the time, plus
WindowAttribute is a read/write property, unlike the compiler error in
2.0.4 where you could use Include() with a read-only property.  Is
this not a regression bug in FPC 2.3.1 maybe?

2.3 prevents you form taking the address of a property, because that way you can read/write its value directly, circumventing the getter/setter. So you cannot use the @ operator, but neither can you pass properties to var parameters. Include is an internal procedure that calls an rtl function that receives the set as a "var" parameter, preventing include to work.

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].
- While include is not a real procedure, its set parameter is clearly
  defined as "var". Passing properties to var parameters is not allowed,
  so it should not be allowed for include either.

Daniël
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to