mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Certain uses of protocols only formally need the requirement signature, not any of the method requirements. This results in IRGen seeing a protocol where none of the members have been validated except the associated types. Account for this by allowing ProtocolInfo to only contain the layout for the base protocols and associated types, if requested. Note that this relies on the layout of a witness table always putting the "requirement signature part" at the front, or at least at offsets that aren't affected by function requirements. rdar://problem/43260117
21 lines
336 B
Swift
21 lines
336 B
Swift
protocol Proto {
|
|
var prop: Int { get set }
|
|
}
|
|
extension Proto {
|
|
func method() {}
|
|
}
|
|
|
|
var globalExistential: Proto {
|
|
fatalError()
|
|
}
|
|
|
|
protocol ClassProtoBase: AnyObject {
|
|
var baseProp: Int { get set }
|
|
}
|
|
protocol ClassProto: ClassProtoBase {
|
|
var prop: Int { get set }
|
|
}
|
|
func getClassExistential() -> ClassProto? {
|
|
fatalError()
|
|
}
|