Bug 11818 – Ternary operator not allowed in a value parameter anymore
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-25T16:16:00Z
Last change time
2014-01-15T09:44:53Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
andrei
Comments
Comment #0 by andrei — 2013-12-25T16:16:55Z
This used to work:
enum E { e0, e1 }
struct SortedRange
{
void fun(E e = true ? E.e0 : E.e1)()
{
}
}
void main(string[] args)
{
SortedRange s;
s.fun();
}
Now I get:
Error: expression true ? e0 : e1 is not a valid template value argument