www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13462] New: Renamed imported module can be accessed by FQN

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

          Issue ID: 13462
           Summary: Renamed imported module can be accessed by FQN when
                    other import is present
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: ybyt4t gmail.com

When I try to compile the following program:

---
module main;

import io = std.stdio;

void main(string[] args)
{
    std.stdio.writeln("Hello World!");
}
---

I get an error 'undefined identifier std'. I understand this is the expected
behavior, as with a renamed import as used here, access to the module is only
possible via the rename 'io'. But when add one more non-renamed import, as in

---
module main;

import io = std.stdio;
import std.string;

void main(string[] args)
{
    std.stdio.writeln("Hello World!");
}
---

the compilation works. This seems to be wrong to me.

--
Sep 12 2014