Bug 22701 – std.typecons.apply needlessly checks if the predicate is callable

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-01-24T11:46:19Z
Last change time
2022-01-29T10:00:12Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature

Comments

Comment #0 by default_357-line — 2022-01-24T11:46:19Z
As I said in my DConf talk, __traits(compiles) is Satan, the Great Deceiver. The presence of is(typeof()) in the definition of `apply` needlessly turns a clear, readable error in the passed lambda into an incomprehensible template error that requires advanced language knowledge or blind guessing to untangle. And there's no point, because there's only one apply function! It should just be removed.
Comment #1 by dlang-bot — 2022-01-24T11:48:02Z
@FeepingCreature created dlang/phobos pull request #8364 "Fix issue 22701: Remove is(typeof()) callable check in std.typecons.apply." fixing this issue: - Fix issue 22701: Remove is(typeof()) callable check in std.typecons.apply. It creates unreadable template errors for no benefit. https://github.com/dlang/phobos/pull/8364
Comment #2 by dlang-bot — 2022-01-29T10:00:12Z
dlang/phobos pull request #8364 "Fix issue 22701: Remove is(typeof()) callable check in std.typecons.apply." was merged into master: - ac5c8d0c85d1f3111ea6319018b36ec95ac19177 by Mathis Beer: Fix issue 22701: Remove is(typeof()) callable check in std.typecons.apply. It creates unreadable template errors for no benefit. https://github.com/dlang/phobos/pull/8364