www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13009] New: inout overload conflicts with non-inout when used


          Issue ID: 13009
           Summary: inout overload conflicts with non-inout when used via
                    alias this
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com
            Blocks: 12368


///////// test.d ////////
struct T
    void put(char c) {}

struct S
    T t;

    T getT()
        return t;

    inout(T) getT() inout
        return t;

    alias getT this;

alias Sput = S.put;

This produces the errors:

test.d(25,1): Error: test.S.getT called with argument types () matches both:
test.d(11,7):     test.S.getT()
test.d(17,14):     test.S.getT()

If this is not a compiler bug, then the implementation of RefCounted needs to
be changed to account for this behavior.

Jun 30 2014