[Issue 21272] New: Overzealous and inconsistent foreach shadowing deprecations for nested functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 23 15:17:21 UTC 2020


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

          Issue ID: 21272
           Summary: Overzealous and inconsistent foreach shadowing
                    deprecations for nested functions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dlang-bugzilla at thecybershadow.net

////////////////// test.d //////////////////
void fun()
{
    int var1, var2, var3;

    void gun()
    {
        int var1; // OK?

        int[] arr;
        foreach (i, var2; arr) {} // OK?

        int[int] aa;
        foreach (k, var3; aa) {} // Not OK??
    }
}
////////////////////////////////////////////

Introduced in https://github.com/dlang/dmd/pull/10404

--


More information about the Digitalmars-d-bugs mailing list