[Issue 4953] opBinary, opBinaryRight don't do implicit conversion properly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 30 01:48:58 PDT 2010


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |clugdbug at yahoo.com.au
            Summary|opBinaryRight for "in"      |opBinary, opBinaryRight
                   |doesn't work right          |don't do implicit
                   |                            |conversion properly


--- Comment #2 from Don <clugdbug at yahoo.com.au> 2010-09-30 01:48:40 PDT ---
(In reply to comment #1)
> Further evidence, this compiles:
> 
> void main()
> {
>     S s;
>     s.opBinaryRight!"in"(5);
> }

This is not specific to "in". The code below fails to compile, but it works if
you change "short" to "int".

struct S
{
    void opBinary(string op)(short x) 
    {}
}

void main()
{
    S s;
    s + 5;
}

Original title for this bug was:
opBinaryRight for "in" doesn't work right

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