On 11/08/2022 18:11, Juha Manninen via fpc-devel wrote:
The MaxValue is used in many places for enum and set properties while GetEnumNameCount() is not used anywhere.
There are other similar bugs. At least these 2 in propedits.pp look fishy:
- procedure TSetPropertyEditor.GetProperties
CompType of a set is an enum, so yes => GetEnumNameCount

- subfunction IsPropInSet under function IsInteresting
seems the same


OK, it was not a bug in FPC code. Sorry.


fpc code is still "unexpected".

It takes into account the MinValue

type TMyEnum = (a=5, b=7);

GetEnumName(pt, 5) // a
GetEnumName(pt, 6) // b // should be 7

if it is just the nth name, then it should start at 0 (or if needs be at 1).
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to