https://issues.dlang.org/show_bug.cgi?id=18436
Issue ID: 18436 Summary: broken opCast fails silently when used with std.conv.to Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: elpenguin...@gmail.com Invalid code like the following will (correctly) fail to compile, but the error preventing it from compiling will not be shown to the user. struct X { T opCast(T)() { nonexistent(); return T.init; } } assert(X().to!bool == bool.init); The compiler ought to complain about nonexistent being undefined instead of simply failing to match toImpl's template declaration. --