https://issues.dlang.org/show_bug.cgi?id=18584
Issue ID: 18584 Summary: Undefined identifier when not specifying 'this' Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: simen.kja...@gmail.com This program gives the error message 'undefined identifier n': struct S { int n; auto fun() { return tmp!(a => n)(); } } struct tmp(alias fns) { alias fun = fns!int; } If you just add 'this', it works: struct S { int n; auto fun() { return tmp!(a => this.n)(); } } struct tmp(alias fns) { alias fun = fns!int; } There should be no ambiguity here as to which 'n' I'm referring to, and 'this' should be unnecessary. --