Files
swift-mirror/validation-test/Evolution/Inputs/backward_deploy_conformance.swift
Slava Pestov 1ca2b61f7a Runtime: Less eager instantiation of type metadata in the conformance cache
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>.
2020-02-17 16:24:42 -05:00

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