programmer’s guide confusingly documents $scopedEnums directive
Original Reporter info from Mantis: kays @KaiBurghardt
-
Reporter name: Kai Burghardt
Original Reporter info from Mantis: kays @KaiBurghardt
- Reporter name: Kai Burghardt
Description:
The programmer’s guide’s documentation of $scopedEnums suggests, that either enumeration type members are inserted without a type name prefix or with it. This is not the case (anymore).
The $scopedEnums directive (now) only controls, whether a non-scoped alias is inserted, too.
All enumeration symbols are inserted with their fully-qualified name into symbol table, a short non-prefixed alias is optional.
The programmer’s guide gives the example, quote: ”The following will give an error:
begin
A:=TMyEnum.one;
end.”
However, this works (now) and does not cause any error.
Steps to reproduce:
program scopedEnumsDemo(input, output, stdErr);
{$scopedEnums off}
type
namedNumber = (one, two, three);
var
x: namedNumber;
begin
x := one;
// !!! _scoped_ access valid, too:
x := namedNumber.three;
end.
Mantis conversion info:
- Mantis ID: 37480
- OS: GNU/Linux
- OS Build: 4.2.0
- Build: 3.0.4+dfsg-11 [2017/12/30]
- Platform: x86_64
- Version: 3.0.4
- Fixed in version: 3.3.1
- Fixed in revision: 1741 (#a1f80bf7)
- Target version: 3.2.2