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: nob...@puremagic.com
        ReportedBy: a...@lycus.org


--- Comment #0 from Alex Rønne Petersen <a...@lycus.org> 2012-08-08 01:54:18 
CEST ---
┌─[alexrp@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@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: -------

Reply via email to