mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The ConformanceCandidate constructor would eagerly instantiate metadata for all non-generic types in the conformance cache. This was not the intention of the code though, because it can compare nominal type descriptors -- which are emitted statically -- for those types that have them, namely everything except for foreign and Objective-C classes. Change the order of two calls so that the lazy path has a chance to run. This fixes a crash when type metadata uses weakly-linked symbols which are not available, which can come up in backward deployment scenarios. Fixes <rdar://problem/59460603>.
19 lines
199 B
Swift
19 lines
199 B
Swift
public func getVersion() -> Int {
|
|
#if BEFORE
|
|
return 0
|
|
#else
|
|
return 1
|
|
#endif
|
|
}
|
|
|
|
#if AFTER
|
|
@_weakLinked
|
|
public struct NewStruct<T> {
|
|
var t: T
|
|
|
|
public init(_ t: T) {
|
|
self.t = t
|
|
}
|
|
}
|
|
#endif
|