Files
swift-mirror/test/attr/Inputs/attr_usableFromInline_protocol_hole_helper.swift
Jordan Rose cd22c5d546 Use access scopes for the hard cases in ValueDecl::isAccessibleFrom
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.
2018-07-23 16:36:16 -07:00

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 {}