October 15, 2019
https://issues.dlang.org/show_bug.cgi?id=20298

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

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

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
Isn't the real bug here the fact that calling ipred passes compilation? As far as I could tell the lambda template instantion is inside the scope of the S struct => you cannot call it from fun, since fun may call only const functions and pred is mutable.

--
October 15, 2019
https://issues.dlang.org/show_bug.cgi?id=20298

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Thanks for looking at this!

(In reply to RazvanN from comment #1)
> As
> far as I could tell the lambda template instantion is inside the scope of
> the S struct

Hmm! But, shouldn't it infer that since it doesn't access anything other than its arguments, it should not have a context?

I see that ipred is typed as a function not delegate.

> you cannot call it from fun, since fun may call only const functions and pred is mutable.

Thanks, I actually didn't realize that fun being const was a crucial part of this. I guess the error message could be better.

--