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.

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

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

Reply via email to