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[];
Comment #1 by bugzilla — 2018-12-12T07:55:51Z
Comment #2 by github-bugzilla — 2018-12-14T00:12:15Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c807c046be63c9787500424e64910f6d52e1f767 fix Issue 19447 - [REG2.066] fixed size slice assignment in ctfe loses connection with array https://github.com/dlang/dmd/commit/6064ba87796fcba76f8f00613d3ae4a5c2c2376d Merge pull request #9071 from WalterBright/fix19447 fix Issue 19447 - [REG2.066] fixed size slice assignment in ctfe lose…