https://issues.dlang.org/show_bug.cgi?id=17336
Nick Treleaven <n...@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |n...@geany.org --- Comment #5 from Nick Treleaven <n...@geany.org> --- (In reply to Adam D. Ruppe from comment #4) > I understand that's a bit of a pain to write, but it is more accurate. The > implementation of canAdd might be `__traits(compiles, () { A a = A.init; B b > = B.init; auto c = a + b; });` ... though that's a bit fragile too, since > vrp may someday cross statement boundaries and then the same thing comes up > again. But it'd work for now at least... Best to avoid init altogether: __traits(compiles, (A a, B b) { auto c = a + b; }) --