-
Notifications
You must be signed in to change notification settings - Fork 271
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
Runtime type error when using StreamTransformer-based APIs #683
Comments
I also had this issue |
See also: dart-lang/web_socket_channel#65, specifically
Following this approach, the error goes away if I replace |
In |
…m(StreamTransformer)` (#684) Closes #683 * add nullable test for backpressure * add nullable test for concat_with_test.dart * to ignore_elements_test.dart * to on_error_return_with_test.dart * add tests * bind * add types * changelog * changelog * changelog * changelog * changelog * wip * remove checkNotNull throttle * add type windowTest
Repro:
The error goes away if you swap the imports.
Reading up a bit on the issue indicates that this is due to Dart's covariant class generics. There are some sharp edges when it comes to classes that handle generics as both function arguments ("in" position) and return types ("out" position) or both - which is exactly what StreamTransformers do. Some relevant links:
The text was updated successfully, but these errors were encountered: