flutter / flutter/flutter

[pigeon][swift 6]use typed throw for swift codegen

Open
#151,485 2 comments 0 reactions 0 assignees View on GitHub
p: pigeon P3 package platform-ios team-ios triaged-ios
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

Swift 6 introduces ["typed throws"](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0413-typed-throws.md):

```
func foo() throws(MyError) { … }

do {
try foo()
} catch {
// error here is of type MyError (rather than of type `Error`)
}
```

A good way to force developers to throw `PigeonError`.

Only available for Swift 6 though, so will need to fix all the concurrency warnings before we can use it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.