Thread overview
[Issue 21633] anonymous class local scope confusion
Feb 13, 2021
Adam D. Ruppe
Dec 17, 2022
Iain Buclaw
February 13, 2021
https://issues.dlang.org/show_bug.cgi?id=21633

--- Comment #1 from Adam D. Ruppe <destructionator@gmail.com> ---
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.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=21633

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 13
https://issues.dlang.org/show_bug.cgi?id=21633

--- Comment #2 from dlangBugzillaToGithub <robert.schadek@posteo.de> ---
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19873

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB

--