Bug 20554 – std.algorithm.searching.all 's static assert produces a garbled error message

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-02-01T08:51:53Z
Last change time
2021-09-22T08:12:00Z
Keywords
pull
Assigned to
No Owner
Creator
mipri

Comments

Comment #0 by mipri — 2020-02-01T08:51:53Z
This invocation of rdmd: rdmd --eval '"hi".all!isWhite' yields this error message: /usr/include/dmd/phobos/std/algorithm/searching.d(125): Error: static assert: "sWhit isn't a unary predicate function for range.front" which complains about 'sWhit' instead of 'isWhite'. This happens due to static assert(is(typeof(unaryFun!pred(range.front))), "`" ~ pred.stringof[1..$-1] ~ "` isn't a unary predicate function for range.front"); which assumes that pred is a string whose .stringof needs to be stripped of double quotes.
Comment #1 by dlang-bot — 2021-09-18T06:07:20Z
@jrfondren created dlang/phobos pull request #8246 "Fix issue 20554 - std.algorithm.searching.all 's static assert produc…" fixing this issue: - Fix issue 20554 - std.algorithm.searching.all 's static assert produces a garbled error message https://github.com/dlang/phobos/pull/8246
Comment #2 by dlang-bot — 2021-09-22T08:12:00Z
dlang/phobos pull request #8246 "Fix issue 20554 - std.algorithm.searching.all 's static assert produc…" was merged into master: - dc2bf7901f0c5ba06f16ef7dd5927908cf782368 by Julian Fondren: Fix issue 20554 - std.algorithm.searching.all 's static assert produces a garbled error message https://github.com/dlang/phobos/pull/8246