import std.algorithm;
class S {
int foo(int a) { return a; }
void test() {
[ 1, 2, 3 ].map!foo;
}
}
Error: this for foo needs to be type S not type MapResult!(foo, int[])
changing foo to (a => foo(a))
makes it compileable
Comment #1 by k.hara.pg — 2016-03-10T12:55:21Z
Since 2.030 to 2.070, all versions fail to compile the code.
Which version has succeed to compile with?
Comment #2 by temtaime — 2016-03-10T14:30:51Z
Hmmm, i though it was combpilable some time ago
OK, not a regression then
Comment #3 by b2.temp — 2017-01-15T23:02:03Z
foo is a member function but map takes an alias to a function that must be known at compile time. change definition to
static int foo(int a) { return a; }
and it works