Bug 14672 – [REG2.067.0] Internal error: e2ir.c 4620 when copying array of derived class to an array of base class

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-09T18:55:00Z
Last change time
2015-06-17T21:05:55Z
Keywords
ice, pull, rejects-valid
Assigned to
nobody
Creator
petar.p.kirov

Comments

Comment #0 by petar.p.kirov — 2015-06-09T18:55:50Z
To reproduce: class B {} class D : B {} void main() { D[] arr_d; B[] arr_b; arr_b[] = arr_d[]; // Internal error: e2ir.c 4620 arr_b = cast(B[])arr_d; // Requires cast, cuz of arr_b = arr_d; // "Error: cannot implicitly // convert expression (arr_d) of type D[] to B[]" D d = new D(); arr_b = [d]; // This does work as expected } Tested in DMD64 D Compiler v2.067.1 on Linux.
Comment #1 by k.hara.pg — 2015-06-10T01:50:16Z
Regression from 2.067.0.
Comment #2 by k.hara.pg — 2015-06-10T12:21:04Z
Comment #3 by github-bugzilla — 2015-06-12T13:28:06Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/306e7b146535c84c065c41f52b3674c2ee1ac832 fix Issue 14672 - Internal error: e2ir.c 4620 when copying array of derived class to an array of base class https://github.com/D-Programming-Language/dmd/commit/c30cddff4a884d9695cb90871835df4f4cd0b810 Merge pull request #4736 from 9rnsr/fix14672 [REG2.067.0] Issue 14672 - Internal error: e2ir.c 4620 when copying array of derived class to an array of base class
Comment #4 by github-bugzilla — 2015-06-17T21:05:55Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/306e7b146535c84c065c41f52b3674c2ee1ac832 fix Issue 14672 - Internal error: e2ir.c 4620 when copying array of derived class to an array of base class https://github.com/D-Programming-Language/dmd/commit/c30cddff4a884d9695cb90871835df4f4cd0b810 Merge pull request #4736 from 9rnsr/fix14672