Files
swift-mirror/test/NameLookup/Inputs/private_import/Ghost.swift
Brent Royal-Gordon 806125d6f8 Favor private imports during name lookup
Private imports are intended to make the file performing the import more or less source-compatible with the file being imported from, so that code from the original file can be modified by relatively simple syntactic transformations. However, their name shadowing behavior was very different from the original file. In the original file, other declarations in the same module would have shadowed declarations imported from any other module; in a file using a @_private import, they would all be considered imports, and thus all would be preferred equally. This could cause ambiguity in a file using a @_private import that was not present in the original file.

This commit changes that behavior by favoring @_private imports over other imports, so that if a name is visible through both a private and a non-private import, the one visible through the private import will shadow the other. This shadowing takes a higher priority than a scoped import, but a lower priority than the check for whether one of the modules is only visible through the other.

Fixes rdar://68312053.
2020-09-23 14:04:17 -07:00

3 lines
122 B
Swift

@available(*, deprecated, message: "got Ghost version")
public enum Coast { case airCurrent } // Also defined in Most