The following source code doesn't compile because in the lambda 'a.bar' is written instead of 'a.foo'. import std.algorithm: canFind; struct A { string foo; } void main() { A[] arr; arr.canFind!(a => a.bar); } It isn't clear from the error message, that the property'bar' is causing the error: source\app.d(9): Error: template std.algorithm.canFind cannot deduce function from argument types !((a) => a.bar)(A[]), candidates are: C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(11266): std.algorithm.canFind(alias pred = "a == b") I would expect an error message: no property 'bar' for type 'A'
Like Issue 13683, this is caused by canFind's template constraint rather than dmd. It could be changed to use a static assert, so that the error mentions that the lambda can't take an A.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10116 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB