import std.stdio;
class hello {
int x = 42;
// should not have access to `this.*`
int function() f = function() {
// accesses `this.x`
return x;
};
}
void g(int function() h) {
writeln(h());
}
void main() {
auto h = new hello();
// outputs 42
writeln(h.f());
// segfaults
g(h.f);
}
Comment #1 by d+bugzilla — 2013-11-18T17:56:25Z
*** Issue 10336 has been marked as a duplicate of this issue. ***