The following program prints "true" when compiled together, and "false" when compiled separately: --- dub.json { "name": "example" } --- source/app.d import node; void main() { import std.stdio; writeln(__traits(compiles, Struct.init == Struct.init)); } --- source/node.d import example; alias Node = Example!Struct; struct Struct { Node[] nodes; } --- source/example.d struct Example(T) { T t; static if (__traits(compiles, T.init == T.init)) { bool opEquals(Example!T rhs) { return this.t == rhs.t; } } else { @disable bool opEquals(Example!T rhs); } } --- To build and run with dub: $ dub --quiet build --build-mode=singleFile --force && dub --quiet run false $ dub --quiet build --force && dub --quiet run true
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19511 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB