Bug 10553 – Access specifiers on anon enums have no effect
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-05T14:00:00Z
Last change time
2016-08-27T21:03:05Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2013-07-05T14:00:41Z
-----
module foo;
private enum
{
A = 1,
B = 2,
}
-----
-----
module test;
import foo;
void main()
{
auto a = A;
}
-----
$ dmd test.d
>
I would assume using 'private' on an an enum would make all the members private, but instead it is a no-op.
Note that you can't even mark individual anon members due to Issue 10552:
-----
enum
{
private A = 1,
B = 2,
}
-----
$ dmd test.d
> Error: basic type expected, not private