[Issue 20246] isCallable fails for template opCall overload

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Sep 27 15:35:26 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20246

--- Comment #2 from Paul Backus <snarwin+bugzilla at gmail.com> ---
Seems like this is an issue with the interface, then, not the implementation;
the question "is S.init callable" is undecidable, so there's not much use
trying to pretend we can answer it.

One possible solution would be a trait like `isCallableWith!(S.init, int)`,
that requires the user to specify the argument type(s). That way, we could just
check with __traits(compiles) whether the call is valid or not.

--


More information about the Digitalmars-d-bugs mailing list