mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This function (actually checkAccess) was relying on some implicit assumptions that aren't actually valid in all cases. When they're not, just fall back to a slower but more correct implementation; when they are, assert that the two implementations get the same answer. This allows us to get rid of adjustAccessLevelForProtocolExtension (see previous commit), though unfortunately not all of the associated hack. The diff is bigger than I'd like because it includes moving functions from NameLookup.cpp into Decl.cpp, but most of those didn't change. - checkAccess only changed in the one if branch for protocols - ValueDecl::isAccessibleFrom just added the assertion - AbstractStorageDecl::isSetterAccessibleFrom did not change No expected functionality change.
21 lines
519 B
Swift
21 lines
519 B
Swift
public protocol PublicProtocol {
|
|
}
|
|
extension PublicProtocol {
|
|
public func publicExtensionMethod() {}
|
|
@usableFromInline internal func ufiExtensionMethod() {}
|
|
internal func internalExtensionMethod() {}
|
|
}
|
|
|
|
public struct PublicImpl: PublicProtocol {}
|
|
|
|
|
|
@usableFromInline internal protocol UFIProtocol {
|
|
}
|
|
extension UFIProtocol {
|
|
public func publicExtensionMethod() {}
|
|
@usableFromInline internal func ufiExtensionMethod() {}
|
|
internal func internalExtensionMethod() {}
|
|
}
|
|
|
|
public struct UFIImpl: PublicProtocol {}
|