swift
e0502945 - [Associated type inference] Limit `Failure` inference to rethrows next()

Commit
1 year ago
[Associated type inference] Limit `Failure` inference to rethrows next() When inferring a type witness for `AsyncIteratorProtocol` or `AsyncSequence`'s `Failure` associated type, don't infer from a generic parameter named `Failure`. Instead, use `next()` as a cue: if it `rethrows`, use `Failure` from one of the conformances; if it `throws`, use `any Error`. This is a more conservative inference rule, and addresses a failure to infer a `Failure` type witness for some fairly-obvious cases. Fixes rdar://122514816.
Author
Parents
Loading