D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21452 - isCallable erroneously returns false on function templates
Summary: isCallable erroneously returns false on function templates
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-12-03 21:32 UTC by Bolpat
Modified: 2020-12-04 00:09 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Bolpat 2020-12-03 21:32:46 UTC
https://dlang.org/phobos/std_traits.html#isCallable reads:

Detect whether T is a callable object, which can be called with the function call operator (...).

However, function templates f that can be called using f!() aren't considered isCallable!f, but certainly can.

The case of function templates that can infer their arguments from run-time arguments won't be easy or even possible.
Comment 1 Dlang Bot 2020-12-03 21:35:19 UTC
@Bolpat created dlang/phobos pull request #7722 "fix Issue 21452 - isCallable erroneously returns false on function templates" fixing this issue:

- fix Issue 21452 - isCallable erroneously returns false on function templates

https://github.com/dlang/phobos/pull/7722
Comment 2 Dlang Bot 2020-12-04 00:09:26 UTC
dlang/phobos pull request #7722 "fix Issue 21452 - isCallable erroneously returns false on function templates" was merged into master:

- 027612038cc5c09802707f3dd497d90489009dd3 by Q. F. Schroll:
  fix Issue 21452 - isCallable erroneously returns false on function templates

https://github.com/dlang/phobos/pull/7722