Difference between "can call" and "can compile"

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Sep 7 16:02:14 UTC 2020


On Mon, Sep 07, 2020 at 10:57:24AM -0400, Steven Schveighoffer via Digitalmars-d wrote:
[...]
> I was wondering, would it be a useful addition to have a way to say
> "can call" instead of "can compile"? In other words, this has a valid
> template IFTI match, regardless of whether it compiles or not. In
> which case, you can distinguish mismatch errors from implementation
> errors.
[...]

Yes, yes, and yes!  This could save hours of hair-tearing frustration
when trying to debug a long UFCS chain where there's a typo in one of
the lambdas.  Having it fail the sig constraint because of a typo means
you get an undecipherable error in the innards of Phobos, far away from
the actual problem, rather than an error in the lambda's body in user
code (which has been gagged because it just so happens to be inside
__traits(compiles) or is(typeof(...))).


T

-- 
Always remember that you are unique. Just like everybody else. -- despair.com


More information about the Digitalmars-d mailing list