Files
swift-mirror/test/IRGen/Inputs/protocol_accessor_multifile_other.swift
Jordan Rose 84f471b031 [IRGen] Handle ProtocolInfo for protocols whose members aren't used (#18692)
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
2018-08-14 11:10:02 -07:00

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()
}