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[]* ---
Comment #1 by k.hara.pg — 2014-09-18T11:53:00Z
Comment #2 by github-bugzilla — 2014-09-25T06:18:22Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9742733c28b5ac3225bbd89e9970e9f7722e7e97 fix Issue 13490 - Can't append to array of structs with alias this as lvalue ternary opoerator result https://github.com/D-Programming-Language/dmd/commit/bad2a619634a85ab7971714c0d7c14d7cfcabe44 Merge pull request #4002 from 9rnsr/fix13490 Issue 13490 - Can't append to array of structs with alias this as lvalue ternary opoerator result
Comment #3 by github-bugzilla — 2015-02-18T03:37:09Z
Commits pushed to 2.067 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9742733c28b5ac3225bbd89e9970e9f7722e7e97 fix Issue 13490 - Can't append to array of structs with alias this as lvalue ternary opoerator result https://github.com/D-Programming-Language/dmd/commit/bad2a619634a85ab7971714c0d7c14d7cfcabe44 Merge pull request #4002 from 9rnsr/fix13490