-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Protocol with typed throwing getter cannot be witnessed #80288
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Comments
Fails with an asserts build as follows:
|
We're not handling the case where an effectful getter's thrown error type contains type parameters at all. It needs to be refactored to open the type first like we do in other cases. I'll try to figure it out. |
slavapestov
added a commit
to slavapestov/swift
that referenced
this issue
Apr 1, 2025
Witness matching didn't handle the case where either the requirement or the witness is a property with a throwing getter, and the thrown error type contains a type parameter. We must open the thrown error types first, replacing type parameters with type variables, for the matching to work. Associated type inference needs a similar fix. I'll land a combined test case for both once I fix that. Fixes swiftlang#80288. Fixes rdar://problem/147874955.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
It does not appear to be possible to fulfill a typed throwing getter requirement in a protocol.
Reproduction
Expected behavior
I expect all of the above code to compile.
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.5 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: