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.
Added missing API:
DecodingFailurePolicy.raiseException
. It is now the default like on Darwin.Match Darwin behavior while decoding if you decode without raising exceptions.
decodeTopLevel…
variants are noted unavailable on swift-corelibs-foundation, with rationale and replacement directions.Swift doesn’t have exceptions, and it used to define
.setErrorAndReturn
as the defaults. However, until very recentlyfailWithError(_:)
was unimplemented and trapped with a fatal error, effectively meaning that all coding failures were behaving as if.raiseException
was set in a Darwin Swift-only app: by crashing.Since code written to 4.x-5.0 may be relying on this behavior, we make it explicit and consistent with Darwin: there is now a
.raiseException
constant, it’s the default, and it fails with a fatal error infailWithError(_:)
. The new secure initializers (at #2102) set.setErrorAndReturn
just like on Darwin, and thus won’t raise and instead just thrown an error.Tests will be added.