www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23271] New: `goto` skips declaration of variable


          Issue ID: 23271
           Summary: `goto` skips declaration of variable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: destructionator gmail.com

dmd master broke this code:

class A {
        private static A[] active;
        private void test() {
                foreach(a; active)
                        if(a is this)
                                goto label;
                active ~= this;

bugred.d(6): Error: `goto` skips declaration of variable
`bugred.A.test.__appendtmp4` at bugred.d(7)

Jul 25 2022