Fix Issue 17630 - selective imports find symbols in private imports o…#7760
Fix Issue 17630 - selective imports find symbols in private imports o…#7760dlang-bot merged 1 commit intodlang:masterfrom
Conversation
|
Thanks for your pull request, @RazvanN7! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla references
|
|
Sounds like this needs to be a deprecation first :( |
|
Thanks a lot for moving this forward, but I fear that this needs a deprecation message instead of a hard error. |
|
I'm discussing with @RazvanN7, he just pushed a change that issues a deprecation. |
changelog/fix17630.dd
Outdated
|
|
||
| A private module-level import should not have any symbols | ||
| visible outside the module scope. For more information | ||
| see https://issues.dlang.org/show_bug.cgi?id=17630 |
There was a problem hiding this comment.
I prefer that the changelog entry is extended to explain the issue and the solution inline without having to read the issue.
There was a problem hiding this comment.
I gave it another shot but I used "imported module" a lot. :(
| AliasDeclaration ad = imp.aliasdecls[i]; | ||
| //printf("\tImport %s alias %s = %s, scope = %p\n", toPrettyChars(), aliases[i].toChars(), names[i].toChars(), ad._scope); | ||
| if (imp.mod.search(imp.loc, imp.names[i])) | ||
| if (imp.mod.search(imp.loc, imp.names[i]) /*, IgnorePrivateImports*/) |
There was a problem hiding this comment.
Why is this comment here?
There was a problem hiding this comment.
When the deprecation is over, that argument should ne uncommented
|
Nice work! |
…f other modules