[Issue 15340] New: Spurious "overlapped default initialization" errors with auto fields

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 14 23:43:42 PST 2015


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

          Issue ID: 15340
           Summary: Spurious "overlapped default initialization" errors
                    with auto fields
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: k.hara.pg at gmail.com

Test case:

module test;
class C
{
    auto a = undef1;
    auto b = undef2;
}

`dmd -o- test` prints:

test.d(4): Error: undefined identifier 'undef1'
test.d(5): Error: undefined identifier 'undef2'
test.d(2): Error: overlapping default initialization for field b and a
test.d(2): Error: overlapping default initialization for field a and b

The last two errors should not be reported.

--


More information about the Digitalmars-d-bugs mailing list