[Issue 15839] [REG2.071-b1] this.outer is of wrong type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 8 18:53:48 PDT 2016


--- Comment #12 from github-bugzilla at puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

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.

Merge pull request #5741 from klickverbot/fixup-15839-ast

Fix invalid AST produced by issue 15839 fix


More information about the Digitalmars-d-bugs mailing list