View mode: basic / threaded / horizontal-split · Log in · Help
April 06, 2012
[Issue 7837] New: A refused opBinaryRight("in") with bad error message
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@puremagic.com
       ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@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: -------
January 16, 2013
[Issue 7837] A refused opBinaryRight("in") with bad error message
http://d.puremagic.com/issues/show_bug.cgi?id=7837


yebblies <yebblies@gmail.com> changed:

          What    |Removed                     |Added
----------------------------------------------------------------------------
            Status|NEW                         |RESOLVED
                CC|                            |yebblies@gmail.com
        Resolution|                            |DUPLICATE


--- Comment #1 from yebblies <yebblies@gmail.com> 2013-01-17 02:14:10 EST ---
*** This issue has been marked as a duplicate of issue 3905 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home