import std.stdio; class Inner {} class Outer { Inner inner; alias inner this; this(Inner i) { inner = i; } } void main() { Inner[] inners = []; inners ~= new Inner; inners ~= new Outer(new Inner); // Appends null foreach(inner; inners){ writeln(">> ", inner); } } --- Output from https://run.dlang.io/ with all dmd compilers: Up to 2.083.1: Success with output: ----- >> onlineapp.Inner >> onlineapp.Inner ----- Since 2.084.0: Success with output: ----- >> onlineapp.Inner >> null -----
@RazvanN7 created dlang/dmd pull request #9550 "Fix Issue 19782 - alias this appends null instead of inner/aliased element to array" fixing this issue: - Fix Issue 19782 - alias this appends null instead of inner/aliased element to array https://github.com/dlang/dmd/pull/9550
dlang/dmd pull request #9550 "Fix Issue 19782 - alias this appends null instead of inner/aliased element to array" was merged into master: - 520e5fc638319273de0514706cd87045d13e7d81 by RazvanN7: Fix Issue 19782 - alias this appends null instead of inner/aliased element to array https://github.com/dlang/dmd/pull/9550