https://issues.dlang.org/show_bug.cgi?id=21633
--- Comment #1 from Adam D. Ruppe <[email protected]> --- Well, upon a review of Java and the D spec, there is a way, pass it as a constructor arg: return new class (a) A { this(int a) { this.a = a; } }; What a weird syntax. In Java it is `new A(a) { }` which is a little less strange. But whatever, this is a possible solution to use the var without renaming it. So I retract that part. I still think the scope behavior, while legal, is problematic to the human eye though, so leaving this enhancement request open. --
