www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15400] New: inconsistent local `import` behavior


          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 puremagic.com
          Reporter: ketmar 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.

Dec 02 2015