fix problems that prevent implementing import shadowing protection#3989
Merged
kyllingstad merged 1 commit intodlang:masterfrom Feb 12, 2016
Merged
fix problems that prevent implementing import shadowing protection#3989kyllingstad merged 1 commit intodlang:masterfrom
kyllingstad merged 1 commit intodlang:masterfrom
Conversation
| import std.bitmanip : littleEndianToNative, nativeToLittleEndian; | ||
| import std.algorithm : max; | ||
| import std.conv : to; | ||
| import std.zlib : compress; |
Member
Author
There was a problem hiding this comment.
The later use of std.zlib.compress() relies on a bug in dmd that messed up the scope list so that std was found. Import binds are supposed to prevent inserting the module package into the symbol table.
Member
There was a problem hiding this comment.
But std is definitely available here by some of the non-selective imports.
addc600 to
cf17637
Compare
| { | ||
| import core.sys.posix.signal; | ||
| import core.sys.posix.signal : kill; | ||
| if (kill(pid.osHandle, codeOrSignal) == -1) |
Member
Author
There was a problem hiding this comment.
This code relied on import core.sys.posix.signal; hiding the upscope kill().
Contributor
|
Auto-merge toggled on |
cf17637 to
f5494d0
Compare
f5494d0 to
8e6faa5
Compare
Member
Author
|
I had to amend ssa_SSSE3.d, too, since it has the same problem. |
kyllingstad
added a commit
that referenced
this pull request
Feb 12, 2016
fix problems that prevent implementing import shadowing protection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changing the language so that local imports no longer 'shadow' other symbols revealed some problems in Phobos, which this addresses.