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

Michael Van Canneyt michael at freepascal.org
Tue Aug 16 13:19:28 CEST 2022

On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote:

> --- code end
> Run it in Delphi and FPC and compare the outputs:
> Delphi output:
> PropCount: 0
> Property info is null
> FPC output:
> PropCount: 1
> Property name: Fruit
> Property kind: tkEnumeration
> As you can see FPC creates a valid PropInfo for the property with valid 
> TypeInfo (PI^.PropType) of the kind tkEnumeration! This is definitely wrong.
> So the solution is either:
> 1.) don't create PropInfo for the Fruit property like Delphi.
> - or -
> 2.) PropType must not be thEnumeration. It should be either tkInteger or 
> a new custom value like tkCEnumeration or whatever. Because 
> thEnumeration means it has the enumeration TypeInfo with GetEnumName and 
> GetEnumValue.

tkInteger or no propinfo at all seems the only correct solution to me, with
slight preference for no propinfo at all.


More information about the fpc-devel mailing list