Skip to content

Added error 'lift' operator that more ergonomically handles mixed error types via combined enum#1830

Merged
kperryua merged 1 commit intoswiftlang:experimental/new-codablefrom
kperryua:mixed-typed-errors
Mar 25, 2026
Merged

Added error 'lift' operator that more ergonomically handles mixed error types via combined enum#1830
kperryua merged 1 commit intoswiftlang:experimental/new-codablefrom
kperryua:mixed-typed-errors

Conversation

@kperryua
Copy link
Copy Markdown
Contributor

Per #1825, improve the ergonomics of JSONError and CodingError.Decoding errors being mixed in recursive JSON parsing. This also eliminates the as! cast that we currently are using to get by, but which isn't compatible with Embedded Swift.

Wishing for better language support here. This pattern being implicitly sugared into the language would be great. But I'd settle for changes to the typed throws inference / overload disambiguation mechanisms that would allow this bespoke operator to be postfix-unary.

@kperryua kperryua added the new-codable Related to new Swift (de)serialization APIs label Mar 18, 2026
@kperryua kperryua force-pushed the mixed-typed-errors branch from 328d186 to 849f8bd Compare March 25, 2026 17:38
@kperryua
Copy link
Copy Markdown
Contributor Author

Merging this major infrastructural change to avoid further drifting.

@kperryua kperryua merged commit 2c56c4d into swiftlang:experimental/new-codable Mar 25, 2026
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-codable Related to new Swift (de)serialization APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Find a new solution to the typed-throws conundrum of JSONError/CodingError

1 participant