https://issues.dlang.org/show_bug.cgi?id=16477
Issue ID: 16477 Summary: Template not properly instantiated Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: johannesp...@gmail.com Reduced from the std.experimental.color code: https://github.com/dlang/phobos/pull/2845 Commands to cause the error: # Simulate phobos library build process dmd std/experimental/color/rgb.d std/experimental/color/lab.d std/experimental/color/package.d std/experimental/normint.d -lib -ofcolor.a # Simulate single module unittest for code coverage dmd -main -unittest std/experimental/color/lab.d color.a Output: lab.o: In function `_D3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedInt11__xopEqualsFKxS3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedIntKxS3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedIntZb': __main.d:(.text._D3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedInt11__xopEqualsFKxS3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedIntKxS3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedIntZb+0xe): undefined reference to `_D3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedInt8opEqualsMxFNaNbNiNfS3std12experimental7normint21__T13NormalizedIntTtZ13NormalizedIntZb' Sources: std/experimental/color/lab.d: ----------------------------------------- import std.experimental.normint; ----------------------------------------- std/experimental/color/package.d: ----------------------------------------- module std.experimental.color; import std.experimental.color.rgb; enum aliceBlue = RGB!(ubyte)(); ----------------------------------------- std/experimental/color/rgb.d: ----------------------------------------- module std.experimental.color.rgb; import std.experimental.normint; import std.typecons ; struct RGB(ComponentType_) { alias ComponentType = NormalizedInt!ComponentType_; enum components_ = "rgba"; template Components(string components) { enum Components = ComponentType.stringof ~ ' ' ~ components[0] ~ ";\n" ; } mixin(Components!components_); @property tristimulus() { return tuple(r); } unittest { // test linear conversion alias lRGBA = RGB!(ushort); } } ----------------------------------------- std/experimental/normint.d: ----------------------------------------- module std.experimental.normint; import std.experimental.color; struct NormalizedInt(I) { bool opEquals(NormalizedInt) const { return true; } } ----------------------------------------- --