Bug 19447 – [REG2.066] fixed size slice assignment in ctfe loses connection with array
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-11-29T17:58:00Z
Last change time
2018-12-14T00:12:16Z
Keywords
CTFE, wrong-code
Assigned to
No Owner
Creator
anonymous4
Comments
Comment #0 by dfj1esp02 — 2018-11-29T17:58:00Z
---
bool f()
{
int[3] a=1;
assert(a[0]==1);
g(a[0..2]);
assert(a[0]!=1); //fails
assert(a[0]==2);
return true;
}
void g(ref int[2] a)
{
int[2] b=2;
a=b;
assert(a[0]==2);
}
static assert(f());
---
The feature was apparently introduced in 2.063 and worked until 2.066.
Works with explicit array operation a[]=b[];