class C(T) { inout this(inout(T)) { } } C!T slice(T)(auto ref T c) { return new C!T(c); } void main() { [1, 2, 3, 4, 5].slice(); }
//Test.d(2): Error: cannot implicitly convert expression (new C(items)) of type inout(C) to Test.C!(int[]).C
class C(T) { inout this(inout(T)) { } } C!T slice(T)(auto ref T c) { return new C!T(c); } void main() { [1, 2, 3, 4, 5].slice(); }
//Test.d(2): Error: cannot implicitly convert expression (new C(items)) of type inout(C) to Test.C!(int[]).C