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
Since 2.030 to 2.070, all versions fail to compile the code. Which version has succeed to compile with?
Hmmm, i though it was combpilable some time ago OK, not a regression then
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