{ auto arr = [1, 2, 3]; auto r = arr.whenEmpty((){ arr = null; }); assert(equal(r, arr)); assert(arr is null); } { auto arr = [1, 2, 3]; auto r = arr.whenEmpty((){ arr = null; }); //assert(equal(r, arr)); r.popFront(); r.popFront(); assert(arr !is null); r.popFront(); assert(arr is null); }