[Issue 199] Label causes scope to collapse into parent

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 24 23:56:04 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=199


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |yebblies at gmail.com
           Platform|x86                         |All
         AssignedTo|bugzilla at digitalmars.com    |yebblies at gmail.com
         OS/Version|Windows                     |All


--- Comment #34 from yebblies <yebblies at gmail.com> 2013-12-25 17:55:30 EST ---
The 9th commandment settles this IMO: "Where D code looks the same as C code,
have it either behave the same or issue an error."

Compiles without error, but fails in D.

==============

int i = 1;

void main()
{
label:
    {
        int i = 2;
    }
    assert(i == 1);
}

==============

I've been porting a fairly large C++ codebase to D (the D frontend) and this
seems to be a fairly pointless gotcha.

https://github.com/D-Programming-Language/dmd/pull/3024

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list