https://issues.dlang.org/show_bug.cgi?id=14534
--- Comment #4 from yebblies <[email protected]> --- (In reply to Iain Buclaw from comment #3) > In some cases, yes. But in this instance, I don't think so. > > After we've verified condition->toBoolean() the only other time semantic > analysis is done on the condition is for optimizations. And I seriously > doubt that we are likely going to get any meaningful constant literal > optimized out from any of these types. One example is error messages - I would much rather see if (dg) than if ((auto tmp = dg, tmp.funcptr != null && tmp.ptr != null)) Lowering to if (cast(bool)dg) would be acceptable, but the lowering would still be in the backend. Maybe this is done late enough that it wouldn't affect error messages anyway? --
