IRGen: Weak-link references to swift_getExtendedExistentialTypeMetadata() [5.9] #69462
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
main PR: IRGen: Weak-link references to swift_getExtendedExistentialTypeMetadata() #69459
Description: The type checker guards certain dynamic uses of constrained existential types SE-0353 behind an availability check, because the runtime entry point to instantiate extended existential metadata is only available on newer OSes. However, even if the metadata instantiation was dynamically unreachable at runtime, we forgot to weak link the symbol. This caused missing symbol errors at runtime.
Scope of the issue: Affects framework authors attempting backward deployment of conditionally-available code that requires extended existential metadata.
Origination: This scenario never worked.
Risk: Very low as this just changes the linkage of a symbol when the deployment target is sufficiently old.
Tested: New test case added.
Reviewed by: @tshortli on main
Radar: rdar://117530421.