Files
swift-mirror/test/Serialization/Inputs/generic_extension_1.swift
Doug Gregor 5775732c21 [Serialization] Filter out XREFs into constrained extensions that should not find declarations there.
The presence of a generic signature in a XREF means that we should only find the result in a (further-constrained) extension with that generic signature. The absence of a generic signature in a XREF means that we should not find the result in a constrained extension. We implemented the former but not the latter, which would lead to deserialization failures if one had both constrained and unconstrained extensions with the same property in them. Methods/initializers weren’t a problem because the generic signature is (redundantly) encoded in their interface type.
2016-08-25 15:52:58 -07:00

24 lines
310 B
Swift

public extension Array {
func wobble() -> Element? { return nil }
}
public protocol P {
var property: Int { get }
}
public protocol Q { }
extension P {
public var property: Int { return 0 }
}
extension P where Self: Q {
public var property: Int { return 0 }
}
public struct ConformsToP: P { }