Thread overview
[Issue 23769] Lambda isn't a unary predicate for lambda that doesn't compile
Mar 11, 2023
Nick Treleaven
Mar 13, 2023
Dlang Bot
Mar 13, 2023
RazvanN
Apr 10, 2023
Dlang Bot
March 11, 2023
https://issues.dlang.org/show_bug.cgi?id=23769

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #1 from Nick Treleaven <nick@geany.org> ---
This is essentially the same as issue 13683, though that was fixed by adding the static assert, though the message doesn't mention that the lambda may not be valid. (It was then widened afterwards and reopened because `all` is unusual in that it uses a static assert instead of a constraint and the rest of Phobos would need adjusting to do the same).

--
March 13, 2023
https://issues.dlang.org/show_bug.cgi?id=23769

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ntrel created dlang/phobos pull request #8715 "[std.algorithm.searching] Don't check template lambda compiles for `all` and `any`" fixing this issue:

- [std.algorithm.searching] Don't instantiate template pred in `all` and `any` constraints

  Fixes Issue 23769 - Lambda isn't a unary predicate for lambda that
  doesn't compile.

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

--
March 13, 2023
https://issues.dlang.org/show_bug.cgi?id=23769

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com
          Component|dmd                         |phobos

--- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> ---
Indeed, this is not a compiler issue. It has to do with how the phobos template is written. I don't see how the compiler can be fixed to prevent the error message of a static assert in the standard library.

--
April 10, 2023
https://issues.dlang.org/show_bug.cgi?id=23769

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #8715 "[std.algorithm.searching] Don't check template lambda compiles for `all` and `any`" was merged into master:

- bb49ffb9e75240e0389d2f30182c4a7634a00d7f by Nick Treleaven:
  [std.algorithm.searching] Don't instantiate template pred in `all` and `any`
constraints

  Fixes Issue 23769 - Lambda isn't a unary predicate for lambda that
  doesn't compile.

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

--