https://issues.dlang.org/show_bug.cgi?id=14894
--- Comment #1 from Martin Nowak <[email protected]> --- Happens b/c the mangling is determined by the number of member in the parent scope. This number can vary between compilations w/ and w/o -unittest. cat > main.d << CODE import bug; void main() { Foo foo; foo.onReceive(); } CODE cat > bug.d << CODE mixin template Protocol() { void onReceive() {} } struct Foo { mixin Protocol!(); unittest { } } CODE ---- dmd -c bug dmd -unittest main bug.o ---- The manifestation of this bug is caused by skipping unittest parsing [¹], but the underlying problem can also be triggered by any other version/debug block member. The code to derive a unique mixin mangling was already added with 2.065.0 [²] and is also used for lambdas. [¹]: https://github.com/D-Programming-Language/dmd/pull/4704 [²]: https://github.com/D-Programming-Language/dmd/pull/3019 --
