https://issues.dlang.org/show_bug.cgi?id=20077
Issue ID: 20077
Summary: Bogus 'need this' for lambda used inside struct
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This fails with 'function `S.test!((a) => a).test` need this to access member
test':
struct S {
pragma(msg, test!(a => a));
}
int test(alias fn)() {
return fn(3);
}
Clearly, a => a does not need access to `this` in S, and something's gone wrong
in the inference here.
--