https://issues.dlang.org/show_bug.cgi?id=15839
--- Comment #12 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/a117c87a8a9ffbccc78b2c28ae3643b5e5b02794 Fix invalid AST produced by issue 15839 fix The fix for 15839 (accessing this.outer from a member function inside a nested class) in bb5f550edd7 produces a ThisExp that refers to the 'this' VarDecl in an outer scope, leading to the latter being referenced from the nested scope without that being added to its nestedRefs. Subsequently, the VarDecl is also not present in the outer FuncDecls closureVars. This is a weird construct, and outside the AST invariants that would previously hold. This commit properly at least properly registers the nested reference, but using a ThisExp in this manner might not be the cleanest way in the first place. https://github.com/dlang/dmd/commit/d178c8578e615c3e68702905b72c3e89bccbecd6 Merge pull request #5741 from klickverbot/fixup-15839-ast Fix invalid AST produced by issue 15839 fix --