[Issue 7837] New: A refused opBinaryRight("in") with bad error message
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 5 17:49:12 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7837
Summary: A refused opBinaryRight("in") with bad error message
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: diagnostic, rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-04-05 17:49:50 PDT ---
immutable struct Foo {
bool opBinaryRight(string op="in")(int x) {
return true;
}
}
void main() {
assert(5 in Foo());
}
DMD 2.059beta gives:
test.d(7): Error: rvalue of in expression must be an associative array, not Foo
If this isn't a bug (maybe caused by fixing Issue 7038 ), then this issue is a
diagnostic enhancement request for a better error message :-)
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list