On Tue, 16 Aug 2022, Martin Frb via fpc-devel wrote:

On 16/08/2022 09:37, Michael Van Canneyt via fpc-devel wrote:

On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote:
And function GetEnumValue() is buggy.

It is not buggy. It does not support enumerateds with gaps, because RTTI does not support enumerateds with gaps.
It never has.
...

  Published
    property Fruit : TFruitMore Read FFruit Write FFruit;
...

If you change it to

  EnumType:=TypeInfo(TFruitMore);

Delphi will even write a compile-time error:

Then maybe the property should not compile either.

I agree we should simply forbid it in ObjFPC mode.


What is the point to allow it being published, if then you can not get (correct) typeinfo? (and therefore not stream it)

Like you, I think there is no point...

Michael.
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to