mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
24 lines
310 B
Swift
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 { }
|
|
|
|
|
|
|
|
|