Bug 13630 – Senseless error with foreach over variadic list

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-17T15:04:00Z
Last change time
2015-02-18T03:38:34Z
Keywords
CTFE, pull, rejects-valid
Assigned to
nobody
Creator
temtaime

Comments

Comment #0 by temtaime — 2014-10-17T15:04:02Z
struct S(T) { T[3] arr; this(A...)(auto ref in A args) { auto p = arr.ptr; foreach(ref v; args) *p = 0; } } void main() { enum A = S!float(1); } Error: Array length mismatch assigning [0..0] to [0..3] called from here: (S!float __ctmp1495 = S;
Comment #1 by k.hara.pg — 2014-10-20T13:41:50Z
Comment #2 by github-bugzilla — 2014-10-23T07:40:40Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/60a8d00a19365185283eec5cab32f21df37acf46 fix Issue 13630 - Senseless error with foreach over variadic list https://github.com/D-Programming-Language/dmd/commit/76cb58b3fe5601326ec84d72006f71f02aa0b6ff Merge pull request #4076 from 9rnsr/fix13630 Issue 13630 - Senseless error with foreach over variadic list
Comment #3 by github-bugzilla — 2015-02-18T03:38:34Z