mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We now test four setups, with the four {before, after}^2 runs of each:
a) Client adds conformance -vs- library adds public conformance -- fixed-layout struct
b) Client adds conformance -vs- library removes internal conformance -- fixed-layout struct
c) Client adds conformance -vs- library adds public conformance -- resilient struct
d) Client adds conformance -vs- library removes internal conformance -- resilient struct
The first two pass, but a) requires a hack to ensure we don't
directly reference conformance table, otherwise the 'after_before'
version doesn't link. I think the right idea here is to weakly
reference conformance tables where the deployment target is
lower than the availability of the conformance.
The second two are XFAIL'd until protocol conformance tables can
reference resilient types from other modules. This requires emitting
indirect metadata symbols, since the client doesn't know if the
resilient type's metadata is direct or a template, and the
conformance table cannot use the metadata accessor either.
These tests will also become important if we decide to revisit
synthesized accessors, and make them lazy again for structs.
29 lines
409 B
Swift
29 lines
409 B
Swift
|
|
public struct RemoveConformance {
|
|
public init() {
|
|
x = 0
|
|
y = 0
|
|
}
|
|
|
|
public var x: Int
|
|
public var y: Int
|
|
|
|
public var z: Int {
|
|
get { return x + y }
|
|
set {
|
|
x = newValue / 2
|
|
y = newValue - x
|
|
}
|
|
}
|
|
}
|
|
|
|
#if BEFORE
|
|
protocol InternalProtocol {
|
|
var x: Int { get set }
|
|
var y: Int { get set }
|
|
var z: Int { get set }
|
|
}
|
|
|
|
extension RemoveConformance : InternalProtocol {}
|
|
#endif
|