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.
Michael.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel