///////////// test.d ///////////// import std.datetime; unittest { cast(void)core.time.hnsecs(1); } ////////////////////////////////// $ dmd -w -unittest -o- test.d test.d(5): Deprecation: module core.time is not accessible here, perhaps add 'static import core.time;' However, std.datetime publicly imports core.time, so the warning is spurious. The code compiles fine when NOT using the fully-qualified name.
(In reply to Vladimir Panteleev from comment #0) > ///////////// test.d ///////////// > import std.datetime; > > unittest > { > cast(void)core.time.hnsecs(1); > } > ////////////////////////////////// > > $ dmd -w -unittest -o- test.d > test.d(5): Deprecation: module core.time is not accessible here, perhaps add > 'static import core.time;' > > However, std.datetime publicly imports core.time, so the warning is > spurious. The code compiles fine when NOT using the fully-qualified name. still there in 2.071.1 beta 2
(In reply to Timothee Cour from comment #1) > (In reply to Vladimir Panteleev from comment #0) > > ///////////// test.d ///////////// > > import std.datetime; > > > > unittest > > { > > cast(void)core.time.hnsecs(1); > > } > > ////////////////////////////////// > > > > $ dmd -w -unittest -o- test.d > > test.d(5): Deprecation: module core.time is not accessible here, perhaps add > > 'static import core.time;' > > > > However, std.datetime publicly imports core.time, so the warning is > > spurious. The code compiles fine when NOT using the fully-qualified name. > > still there in 2.071.1 beta 2 this is also broken: fun.d: public import std.string public static import std.string main.d: import fun; void main(){ auto a=std.string.isNumeric("12"); // module std.string is not accessible here, perhaps add 'static import std.string;' }
I think handling this is simply missing. Will be added for the next point release.
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/0a20f1d407281f61da5b6386fdbe762bab410200 fix Issue 15900 - public imports not accessible using FQN - public imports in imported modules were not accessbile using their FQN, this was an oversight when adding the package tree masking to fix Bugzilla 313 (see #5426) - fixed by recursively checking imported scopes for accessible packages - reuse Module.insearch to not follow import cycles - Uses the same reduced visibility distinction (only private vs. rest) as the unqualified symbol search, b/c extending importedScopes to track rich visibility (e.g. package(a.b)) was out of scope for a regression fix. This should be implemented when combining the search/import w/ the symbol visibility mechanism. https://github.com/dlang/dmd/commit/4caed5518c492341a23f1da890c2931e73e0296a Merge pull request #5967 from MartinNowak/fix15900 fix Issue 15900 - public imports not accessible using FQN
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/0a20f1d407281f61da5b6386fdbe762bab410200 fix Issue 15900 - public imports not accessible using FQN https://github.com/dlang/dmd/commit/4caed5518c492341a23f1da890c2931e73e0296a Merge pull request #5967 from MartinNowak/fix15900
https://github.com/dlang/dmd/pull/6014