Bug 7612 – Bad error message when missing compile time opCmp in struct used in enums
Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-29T10:43:00Z
Last change time
2014-08-07T20:37:11Z
Assigned to
nobody
Creator
simendsjo
Comments
Comment #0 by simendsjo — 2012-02-29T10:43:05Z
Notice the error message says that "S.opCmp is not callable using E".
struct S {
int opCmp(ref const S2 other) {
return 0;
}
}
enum E : S {
a = S(),
b = S()
}
Error: undefined identifier S2, did you mean struct S?
Error: function opcmp.S.opCmp (ref _error_) is not callable using argument types (E)
Error: function opcmp.S.opCmp (ref _error_) is not callable using argument types (E)
Related to http://d.puremagic.com/issues/show_bug.cgi?id=4423
Comment #1 by hsteoh — 2014-08-07T20:37:11Z
On git HEAD, only the first error message is displayed now:
test.d(2): Error: undefined identifier S2, did you mean struct S?
So, seems like this bug has been fixed.