[fpc-devel] Gaps in a non-contiguous enum

Martin Frb lazarus at mfriebe.de
Tue Aug 16 11:18:25 CEST 2022


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)



More information about the fpc-devel mailing list