mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This is sort of two commits squashed into one: first, update ReferencedNameTracker to record whether a name or type is non-private, along with changing all clients to assume non-private; and second, actually try to (conservatively) decide if a particular unqualified lookup can be considered private. What does "private" mean? That means that a dependency does not affect "downstream" files. For example, if file A depends on B, and B depends on C, then a change in C normally means A will get rebuilt. But if B's dependencies on C are all private dependencies (e.g. lookups from within function bodies), then A does not need to be rebuilt. In practice there are several rules about when we can make this assumption, and a few places where our current DeclContext model is not good enough to distinguish private uses from non-private uses. In these cases we have to be conservative and assume that the use is non-private (and thus that downstream files will need to be rebuilt). Part of rdar://problem/15353101 Swift SVN r23447
64 lines
1.8 KiB
Swift
64 lines
1.8 KiB
Swift
class ClassFromOtherFile {}
|
|
|
|
// This Int16 is specifically checked for in the primary file.
|
|
typealias AliasFromOtherFile = Int16
|
|
|
|
func funcFromOtherFile() {}
|
|
|
|
struct OtherFileOuterType {
|
|
struct InnerType {
|
|
static let sharedConstant = 42
|
|
}
|
|
}
|
|
|
|
struct OtherFileSecretTypeWrapper {
|
|
struct SecretType {
|
|
static let constant = 42
|
|
}
|
|
}
|
|
|
|
typealias OtherFileAliasForSecret = OtherFileSecretTypeWrapper.SecretType
|
|
|
|
prefix operator *** {}
|
|
|
|
typealias OtherFileAliasForFloatLiteralConvertible = FloatLiteralConvertible
|
|
|
|
|
|
protocol OtherFileProto {}
|
|
struct OtherFileProtoImplementor : OtherFileProto {}
|
|
func otherFileGetImpl() -> OtherFileProtoImplementor {}
|
|
func otherFileUse(_: OtherFileProto) {}
|
|
|
|
protocol OtherFileProto2 {}
|
|
struct OtherFileProtoImplementor2 : OtherFileProto2 {}
|
|
func otherFileGetImpl2() -> OtherFileProtoImplementor2 {}
|
|
func otherFileUseGeneric<T: OtherFileProto2>(_: T) {}
|
|
|
|
func topLevel1() -> Int { return 2 }
|
|
func topLevel2() -> Int { return 2 }
|
|
func topLevel3() -> Int { return 2 }
|
|
func topLevel4() -> Int { return 2 }
|
|
func topLevel5() -> Int { return 2 }
|
|
func topLevel6() -> Int { return 2 }
|
|
func topLevel7() -> Int { return 2 }
|
|
func topLevel8() -> Int { return 2 }
|
|
func topLevel9() -> Int { return 2 }
|
|
|
|
typealias TopLevelTy1 = Int
|
|
typealias TopLevelTy2 = Int
|
|
typealias TopLevelTy3 = Int
|
|
|
|
func privateTopLevel1() -> Int { return 2 }
|
|
func privateTopLevel2() -> Int { return 2 }
|
|
func privateTopLevel3() -> Int { return 2 }
|
|
func privateTopLevel4() -> Int { return 2 }
|
|
func privateTopLevel5() -> Int { return 2 }
|
|
func privateTopLevel6() -> Int { return 2 }
|
|
func privateTopLevel7() -> Int { return 2 }
|
|
func privateTopLevel8() -> Int { return 2 }
|
|
func privateTopLevel9() -> Int { return 2 }
|
|
|
|
typealias PrivateTopLevelTy1 = Int
|
|
typealias PrivateTopLevelTy2 = Int
|
|
typealias PrivateTopLevelTy3 = Int
|