Bug 13490 – Can't append to array of structs with alias this as lvalue ternary opoerator result
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-18T08:43:00Z
Last change time
2015-02-18T03:37:09Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg
Comments
Comment #0 by verylonglogin.reg — 2014-09-18T08:43:35Z
This code should compile:
---
struct S
{
int i;
alias i this;
}
struct T
{
S[] a1, a2;
}
void main()
{
T t;
(1 ? t.a1 : t.a2) ~= S.init;
}
---
main.d(16): Error: &t.a1 is not an lvalue
main.d(16): Error: &t.a2 is not an lvalue
main.d(16): Error: cannot append type S to type S[]*
---