[Issue 19541] New: Confusing error message about missing opEquals for AA key
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jan 3 01:45:08 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19541
Issue ID: 19541
Summary: Confusing error message about missing opEquals for AA
key
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: acehreli at yahoo.com
struct S {
bool opEquals(ref const(S) that) const {
here_is_a_compilation_error;
}
}
struct T {
string[S] aa; // <-- Compilation error
}
void main() {
}
Error: AA key type `S` does not have `bool opEquals(ref const S) const`
The message is confusing because the AA key type S satisfies what it says.
Apparently, the problem is actually with a compilation error inside that
function but the user is fooled by the message and is now looking for
unnecessary workarounds instead of fixing the compilation error.
Ali
--
More information about the Digitalmars-d-bugs
mailing list