[Issue 18039] Deprecation: symbol is not visible from module when accessed in a with () of something that imports it

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 14 13:09:54 UTC 2018


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

RazvanN <razvan.nitu1305 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305 at gmail.com

--- Comment #1 from RazvanN <razvan.nitu1305 at gmail.com> ---
The compiler does the right thing here. According to the spec:
https://dlang.org/spec/statement.html#WithStatement , the symbol resolution is
done by first searching the members of second. It then finds the selective
import and thinks that an illegal access is being made. That is correct and in
this case it is the user's job to disambiguate :

(1) writeln(third.Third.stringof)
(2) making the import in Struct second public
(3) making the import in Struct second non-selective (e.g. import third) 

Closing as invalid.

--


More information about the Digitalmars-d-bugs mailing list