https://issues.dlang.org/show_bug.cgi?id=15908
Issue ID: 15908
Summary: Implicitly typed lambda inside class "has no value"
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
There is a compile error for an implicitly typed lambda expression inside a
class.
import std.algorithm : map;
auto a = [1,2,3].map!(i => i);
class X {
static auto b = [1,2,3].map!((int i) => i);
// /usr/include/dmd/phobos/std/algorithm/iteration.d(455): Error:
this.__lambda4 has no value
static auto c = [1,2,3].map!(i => i);
}
`a` and `b` compile just fine, but `c` causes a compile error. (The error
message doesn't indicate what caused it, though.)
--