Odd compiler error messages with case and ifdefs

Unbenannt.pas (1.0 KB)

Compiling this file gives this odd messages:

W: Project ‘Unbenannt’ has no Project ID.
E: “case” item “TTypeAttribute.DefaultProperty” overlaps with “TTypeAttribute.DefaultProperty” [D:\temp\RO Tests\RO_Bug5\Unbenannt.pas (29)]
N: Previous declaration was here [D:\temp\RO Tests\RO_Bug5\Unbenannt.pas (29)]
E: “case” item “TTypeAttribute.TDeprecated” overlaps with “TTypeAttribute.TDeprecated” [D:\temp\RO Tests\RO_Bug5\Unbenannt.pas (30)]
N: Previous declaration was here [D:\temp\RO Tests\RO_Bug5\Unbenannt.pas (30)]
E: “case” item “TTypeAttribute.DelphiTypeInfoSymbolName” overlaps with “TTypeAttribute.DelphiTypeInfoSymbolName” [D:\temp\RO Tests\RO_Bug5\Unbenannt.pas (31)]
N: Previous declaration was here [D:\temp\RO Tests\RO_Bug5\Unbenannt.pas (31)]
D:\temp\RO Tests\RO_Bug5\Unbenannt.pas(29,5): duplicate-error E131: “case” item “TTypeAttribute.DefaultProperty” overlaps with “TTypeAttribute.DefaultProperty”
D:\temp\RO Tests\RO_Bug5\Unbenannt.pas(29,5): duplicate-warning N1: Previous declaration was here
D:\temp\RO Tests\RO_Bug5\Unbenannt.pas(30,5): duplicate-error E131: “case” item “TTypeAttribute.TDeprecated” overlaps with “TTypeAttribute.TDeprecated”
D:\temp\RO Tests\RO_Bug5\Unbenannt.pas(30,5): duplicate-warning N1: Previous declaration was here
D:\temp\RO Tests\RO_Bug5\Unbenannt.pas(31,5): duplicate-error E131: “case” item “TTypeAttribute.DelphiTypeInfoSymbolName” overlaps with “TTypeAttribute.DelphiTypeInfoSymbolName”
D:\temp\RO Tests\RO_Bug5\Unbenannt.pas(31,5): duplicate-warning N1: Previous declaration was here
Project ‘Unbenannt’ failed to build.
Solution ‘Unbenannt’ failed to build project ‘Unbenannt’.

Logged as bugs://E26913.

That does indeed look like a bug with {$IFDEF} inside case; I’ve logged an issue to get this addressed, thanx!

bugs://E26913 was closed as fixed.

1 Like