[Issue 8520] New: Simple "in"-constrained opBinaryRight in interface doesn't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 7 16:54:22 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8520

           Summary: Simple "in"-constrained opBinaryRight in interface
                    doesn't work
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: alex at lycus.org


--- Comment #0 from Alex Rønne Petersen <alex at lycus.org> 2012-08-08 01:54:18 CEST ---
┌─[alexrp at zor] - [~/Projects/tests] - [2012-08-08 01:52:24]
└─[$] <> cat test.d
import std.stdio;

interface I
{
    int* opBinaryRight(string op : "in")(int i);
}

class C : I
{
    int* opBinaryRight(string op : "in")(int i)
    {
        return null;
    }
}

void main()
{
    I i = new C;
    int* p = 42 in i;
    writeln(p);
}
┌─[alexrp at zor] - [~/Projects/tests] - [2012-08-08 01:52:26]
└─[$] <> dmd test.d
test.o:test.d:function _Dmain: error: undefined reference to
'_D4test1I30__T13opBinaryRightVAyaa2_696eZ13opBinaryRightMFiZPi'
collect2: ld returned 1 exit status
--- errorlevel 1

It's my understanding that this is supposed to work since the opBinaryRight
template is constrained specifically to "in". This bug makes operators in
interfaces pretty unusable.

-- 
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