takeScopeSlice([ S(1), S(2) ]); // @nogc => no GC allocation
(() @trusted { assert(numDtor == 2); })(); // stack-allocated array literal properly destructed
assert23100([]);
+
+ // https://issues.dlang.org/show_bug.cgi?id=22306
+ // scope array variable should be stack allocated
+ scope int[] sa = [10, 20];
+ assert(sa[0] == 10);
+ assert(sa[1] == 20);
+ assert(sa.length == 2);
+
return 0;
}