--- 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[];
https://github.com/dlang/dmd/pull/9071
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…