www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18039] New: Deprecation: symbol is not visible from module


          Issue ID: 18039
           Summary: Deprecation: symbol is not visible from module when
                    accessed in a with () of something that imports it
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: zorael gmail.com

Arch/Manjaro 64-bit, dmd

import third;

void main()
    import std.stdio;
    import second : Second;

    Second second;
    with (second)

module second;

struct Second
    import third : Third;

module third;

struct Third {}

source/app.d(11,17): Deprecation: second.Second.Third is not visible from
module app

The top-level `import third` in app.d is ignored and it only complains about
implicitly (and erroneously?) inheriting the import from `with (second)`. You
can only silence it by moving the import out of Second (eg. to module-level),
or by placing a new `import third` inside the with ().

Dec 06 2017