Issue in rethrowing protocol #60821
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
concurrency
Feature: umbrella label for concurrency language features
Describe the bug
There might be an issue with the current implementation of rethrowing protocol conformance, that makes possible to throw an Error while the generic parameter is a non Throwing implementation.
Steps To Reproduce
Steps to reproduce the behavior:
Given a type that conforms to a rethrowing protocol such as this AsyncSequence:
we can use it with a non throwing generic AsyncSequence, not using
try awaitalthough we clearly will throw an error in thenext()function:When running that code, the iteration seems to be blocked.
Expected behavior
The compiler should complain about using
tryon a type that is not the generic parameter, just as it does with this code:Environment (please fill out the following information)
Additional context
Forum link: Forum
The text was updated successfully, but these errors were encountered: