Bug 13783 – Function overload with rvalue `inout` parameter not selected when `enum` parameter implicitly converted to its base type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-27T11:53:00Z
Last change time
2015-02-18T03:40:41Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2014-11-27T11:53:24Z
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.