Comment #0 by bearophile_hugs — 2010-03-09T08:18:57Z
This D2 program is wrong:
void main() {
enum Foo { first, second }
enum Foo f = Foo.secod;
}
It prints:
bug.d(3): Error: no property 'secod' for type 'int'
A better error message can be:
bug.d(3): Error: no enumerator 'secod' in enum 'Foo'. Did you mean 'second'?
(The possible match 'second' is chosen in the namespace of Foo only.)
Comment #1 by hoganmeier — 2011-08-22T08:24:21Z
Interestingly Type::getProperty already contains the code to search for and suggest the correct property.
But the problem seems to be that Type is the enum base type instead of the proper enum type in this case.
Comment #2 by andrej.mitrovich — 2012-10-21T14:44:25Z
*** Issue 7350 has been marked as a duplicate of this issue. ***
Comment #3 by andrej.mitrovich — 2014-02-12T13:26:40Z