Skip to content

Conversation

@DougGregor
Copy link
Member

Two unrelated fixes for typed throws:

  • Make sure that key paths can be passed as an argument where the parameter uses typed throws with the generic result type
  • Generalize requirement inference for the thrown error type to handle all types

…typed throws

When providing a key-path literal for a parameter of function type
where that function type has a generic parameter for its thrown error
type, infer `Never` for the generic argument because key paths don't
throw.

Thanks to @xedin for realizing that this would be an issue.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit 0514925 into swiftlang:main Oct 27, 2023
@DougGregor DougGregor deleted the typed-throws-fixes branch October 27, 2023 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants