[Issue 20901] New: arrays confuse static foreach

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 6 19:10:37 UTC 2020


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

          Issue ID: 20901
           Summary: arrays confuse static foreach
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: qs.il.paperinik at gmail.com

Relevant code: https://run.dlang.io/is/DAkfjA

Depending on whether line 12 (front ~= [ ];) is commented in, one of the
asserts fail. Neither assert should fail.

The code in line 12 does nothing but potentially reallocate an array.

The problem seems not to occur when int[] is replaced by int.

--


More information about the Digitalmars-d-bugs mailing list