[5.4][Deserialization] Fix error when typealias required by protocol refers to type in @_implementationOnly module #37490
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.
Cherry-picks #37011 to
release/5.4
.Explanation: If a
typealias
refers to a type defined in a module which is imported as@_implementationOnly
, deserialization fails (crashes). IfLangOpts.EnableDeserializationRecovery
is set totrue
(e.g. in SourceKit), we should recover from such failures more graceful and resolve unknown type as anErrorType
.Scope: Modules that previously failed to deserialize
Risk: Low (we were previously crashing in all cases that exhibit new behavior)
Testing: Added test case to the test suite
Issue: rdar://78035645
Reviewer: Argyrios Kyrtzidis (@akyrtzi), Alexis Laferriere (@xymus)