On Tue, 16 Aug 2022, Ondrej Pokorny via fpc-devel wrote:
Am 16.08.2022 um 13:19 schrieb Michael Van Canneyt via fpc-devel:
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 nu
Am 16.08.2022 um 13:19 schrieb Michael Van Canneyt via fpc-devel:
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 ki
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
Am 16.08.2022 um 09:37 schrieb Michael Van Canneyt via fpc-devel:
On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote:
On Thu, Aug 11, 2022 at 9:37 PM Martin Frb via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
fpc code is still "unexpected".
It takes into account the MinValue
type T
On Tue, 16 Aug 2022, Martin Frb via fpc-devel wrote:
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 n
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.
...
On Tue, 16 Aug 2022, Juha Manninen via fpc-devel wrote:
On Thu, Aug 11, 2022 at 9:37 PM Martin Frb via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
fpc code is still "unexpected".
It takes into account the MinValue
type TMyEnum = (a=5, b=7);
GetEnumName(pt, 5) // a
GetEnumName(pt, 6
On Thu, Aug 11, 2022 at 9:37 PM Martin Frb via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
> 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 nam
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
On Thu, Aug 11, 2022 at 4:44 PM Martin Frb via fpc-devel <
fpc-devel@lists.freepascal.org> wrote:
> Because you are not supposed to use MaxValue
> Instead use GetEnumNameCount
>
> for I := MinValue to MinValue + GetEnumNameCount(...) - 1 do begin
>
> The unit name is returned because the Typ
On 11/08/2022 13:38, Juha Manninen via fpc-devel wrote:
// An empty string and the enum's unit name happen in gaps
// of a non-contiguous enum. Why the unit name? A bug in FPC code?
with GetTypeData(EnumType)^ do
for I := MinValue to MaxValue do begin
s := GetEnumName(Enu
I was able to fix issue
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39832
about TEnumPropertyEditor in Lazarus IdeIntf.
Explanation:
function GetEnumName() in FPC's rtl/objpas/typinfo.pp returns the enum's
unit name for one gap in a non-contiguous enum, and an empty string for the
o
12 matches
Mail list logo