Serialization: Protect deserializeEnum
and more against failures
#80108
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.
Recover from a raw type hidden behind an
internal
or implementation-only import by dropping the whole enum when the raw type is not visible. This scenario should happen only when looking at non-public decl for indexing or debugging, or if dependencies somehow changed and left behind a stale swiftmodule file.Apply the same recovery logic to other notable uses of
getType
at deserializing a class or parameter.Also clean up a few related pieces of code. Rename the macro
UNWRAP
toSET_OR_RETURN_ERROR
for clarity and invert its parameters to have a more intuitive order of assignment target and then expression. And update the multipurpose testimplementation-only-missing.swift
to use split-file.rdar://147091863