-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
It does not appear to be possible to fulfill a typed throwing getter requirement in a protocol.
Reproduction
// Does not work
protocol Fooable {
associatedtype Failure: Error = Never
var prop: Int { get throws(Failure) }
}
extension Int: Fooable {
var prop: Int {
get throws(Never) {
fatalError()
}
}
}
// Works
protocol Barable {
associatedtype Failure: Error = Never
func f() throws(Failure) -> Int
}
extension Int: Barable {
func f() throws(Never) -> Int {
self
}
}
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
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels