www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13783] New: Function overload with rvalue `inout` parameter

https://issues.dlang.org/show_bug.cgi?id=13783

          Issue ID: 13783
           Summary: Function overload with rvalue `inout` parameter not
                    selected when `enum` parameter implicitly converted to
                    its base type
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

This code should work fine:
---
enum E { a }

inout(int) f(inout(int) t) { return t; }
ref inout(int) f(ref inout(int) t) { return t; }

void main()
{
    const E e;
    f(e); // line 9
}
---
main.d(9): Error: constant 0 is not an lvalue
---

May be related to Issue 12068.

--
Nov 27 2014