https://issues.dlang.org/show_bug.cgi?id=16499
Issue ID: 16499
Summary: Useless error message for 'in' expressions
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
struct B {
int k;
void* opBinaryRight(string op)(int x) if (op == "in") {
return &k;
}
}
void main() {
B c;
import std.stdio;
writeln(10 in c);
writeln(1.0 in c);
}
The error reported is:
"Error: rvalue of in expression must be an associative array, not B"
Which is not true, and useless.
--