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.