[Issue 15400] New: inconsistent local `import` behavior

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Dec 2 18:46:32 PST 2015


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

          Issue ID: 15400
           Summary: inconsistent local `import` behavior
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ketmar at ketmar.no-ip.org

this code compiles ok:

void boo () {
  immutable std = 42;
  import std.conv;
}


but this one fails with "declaration z02.boo.std is already defined":

void boo () {
  import std.conv;
  immutable std = 42;
}


i think both variants should have the same behavior: either both should work,
or both should fail.

--


More information about the Digitalmars-d-bugs mailing list