[Issue 19158] declaration is already defined in another scope in main at line

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 16 20:29:00 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=19158

KytoDragon <kytodragon at e.mail.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kytodragon at e.mail.de
           Hardware|x86                         |All
                 OS|Mac OS X                    |All

--- Comment #2 from KytoDragon <kytodragon at e.mail.de> ---
I would like to add, that this also blocks the usage of multiple static
variables with the same name inside one function, not just type definitions.

void main() {
    {
        __gshared int x = 0;
    }
    {
        __gshared float x = 1;
    }
}

This is used by libraries like Dear ImGui.

--


More information about the Digitalmars-d-bugs mailing list