class Foo { } struct Bar { Foo foo; alias foo this; } void main() { Bar bar; bar = new Foo; // ok assert(bar !is null); // ng }
test.d(9): Error: incompatible types for ((bar) !is (null)): 'Bar' and 'void*'(In reply to comment #0) > class Foo { } > struct Bar { Foo foo; alias foo this; } > void main() > { > Bar bar; > bar = new Foo; // ok > assert(bar !is null); // ng > } Error: incompatible types for ((bar) !is (null)): 'Bar' and 'void*'
https://github.com/D-Programming-Language/dmd/pull/466
https://github.com/D-Programming-Language/dmd/commit/57db617ba6eec8ce67bb3f20d33022d534a5dba2