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

--- Comment #0 from 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:
------- You are receiving this mail because: -------

Reply via email to