https://issues.dlang.org/show_bug.cgi?id=24255
Paul Backus <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #3 from Paul Backus <[email protected]> --- Yes, in the current implementation of the DMD frontend, the compiler performs semantic analysis on the argument `(x) {}` *before* it attempts to deduce the template argument `T`, and as a result, it determines that `(x) {}` is template lambda. However, there is nothing in the language spec that requires the DMD frontend to behave this way. In your example, argNG can *only* be a template, because it is explicitly declared as one. But in the original example, the lambda expression `(x) {}` is ambiguous: it could be a template, or it could be a `void function(int)`. Given that the language spec gives the compiler the freedom to interpret `(x) {}` either way, I think it's reasonable to request that the compiler choose the more useful interpretation. Of course, by the same logic, we can't say that the current behavior is *wrong*, so I'll change this to an enhancement request. --
