Closed MichaelRFairhurst closed 4 years ago
With crashes fixed, we're down to 43 errors and 1 warning
Analyzing lib, test...
error • The argument type 'FutureOr<T>? Function()' can't be assigned to the parameter type 'FutureOr<T> Function()'. • lib/src/async_memoizer.dart:43:50 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:54:27 • argument_type_not_assignable
error • The argument type 'FutureOr<R>? Function()' can't be assigned to the parameter type 'FutureOr<R> Function()'. • lib/src/cancelable_operation.dart:102:42 • argument_type_not_assignable
error • The return type 'FutureOr<R>?' isn't a 'FutureOr<R>', as required by the closure's context. • lib/src/cancelable_operation.dart:110:48 • return_of_invalid_type_from_closure
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:110:56 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:112:35 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:195:28 • argument_type_not_assignable
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'EventSink<T?>'. • lib/src/delegate/event_sink.dart:28:7 • return_of_invalid_type
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'Sink<T?>'. • lib/src/delegate/sink.dart:26:7 • return_of_invalid_type
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'StreamConsumer<T?>'. • lib/src/delegate/stream_consumer.dart:28:7 • return_of_invalid_type
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'StreamSink<T?>'. • lib/src/delegate/stream_sink.dart:31:7 • return_of_invalid_type
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/future_group.dart:81:32 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/null_stream_sink.dart:52:29 • argument_type_not_assignable
error • The return type 'ErrorResult' isn't a 'Result<T>', as required by the closure's context. • lib/src/result/result.dart:67:14 • return_of_invalid_type_from_closure
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/result/result.dart:67:26 • argument_type_not_assignable
error • A value of type 'ErrorResult' can't be returned from function 'error' because it has a return type of 'Result<T>'. • lib/src/result/result.dart:80:7 • return_of_invalid_type
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/result/result.dart:89:25 • argument_type_not_assignable
error • A value of type 'ErrorResult?' can't be returned from method 'flatten' because it has a return type of 'Result<T>?'. • lib/src/result/result.dart:176:12 • return_of_invalid_type
error • A value of type 'ErrorResult?' can't be returned from method 'flattenAll' because it has a return type of 'Result<List<T>>?'. • lib/src/result/result.dart:189:16 • return_of_invalid_type
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/stream_completer.dart:101:52 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/stream_queue.dart:486:33 • argument_type_not_assignable
error • The return type 'StreamTransformerWrapper<S, T>' of the redirected constructor isn't assignable to 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:27:46 • redirect_to_invalid_return_type
error • A value of type 'HandlerTransformer<S, T?>' can't be returned from function 'fromHandlers' because it has a return type of 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:40:12 • return_of_invalid_type
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:37:36 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:40:15 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:44:15 • unchecked_use_of_nullable_value
error • The argument type 'Stream<FutureOr<Stream<String>?>> Function()' can't be assigned to the parameter type 'Stream<String>? Function()'. • test/async_cache_test.dart:77:30 • argument_type_not_assignable
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:78:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:79:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:80:13 • yield_of_invalid_type
error • A value of type 'ErrorResult' can't be returned from function 'err' because it has a return type of 'Result<T>'. • test/result/result_flattenAll_test.dart:10:24 • return_of_invalid_type
error • A value of type 'ErrorResult' can't be assigned to a variable of type 'Result<bool>'. • test/result/result_test.dart:70:27 • invalid_assignment
error • A value of type 'ErrorResult' can't be assigned to a variable of type 'Result<bool>'. • test/result/result_test.dart:90:27 • invalid_assignment
error • A value of type 'ErrorResult' can't be assigned to a variable of type 'Result<bool>'. • test/result/result_test.dart:108:27 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:147:19 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:150:19 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:184:19 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:187:19 • invalid_assignment
error • A value of type 'CancelableOperation<Null>' can't be assigned to a variable of type 'CancelableOperation<Never>'. • test/stream_queue_test.dart:1100:46 • invalid_assignment
error • Couldn't infer type parameter 'S'.
Tried to infer 'Null' for 'S' which doesn't work:
Return type declared as 'CancelableOperation<S>?'
used where 'CancelableOperation<Never>?' is required.
Consider passing explicit type argument(s) to the generic.
• test/stream_queue_test.dart:1100:54 • could_not_infer
error • Couldn't infer type parameter 'T'.
Tried to infer 'Null' for 'T' which doesn't work:
Return type declared as 'T* Function()*'
used where 'Never Function()' is required.
Consider passing explicit type argument(s) to the generic.
• test/stream_zip_test.dart:257:29 • could_not_infer
error • A value of type 'Null* Function()*' can't be assigned to a variable of type 'Never Function()'. • test/stream_zip_test.dart:257:29 • invalid_assignment
error • This expression has a type of 'void' so its value can't be used. • test/subscription_stream_test.dart:68:12 • use_of_void_result
warning • The left operand can't be null, so the right operand is never executed. • lib/src/null_stream_sink.dart:73:50 • dead_null_coalesce
Many of these are caused by #40383. Not adding that as a blocker because its related but not blocking.
With implicit downcasts reenabled, we get 29 errors and 1 warning.
Analyzing lib, test...
error • The argument type 'FutureOr<T>? Function()' can't be assigned to the parameter type 'FutureOr<T> Function()'. • lib/src/async_memoizer.dart:43:50 • argument_type_not_assignable
error • The argument type 'FutureOr<R>? Function()' can't be assigned to the parameter type 'FutureOr<R> Function()'. • lib/src/cancelable_operation.dart:102:42 • argument_type_not_assignable
error • The return type 'FutureOr<R>?' isn't a 'FutureOr<R>', as required by the closure's context. • lib/src/cancelable_operation.dart:110:48 • return_of_invalid_type_from_closure
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'EventSink<T?>'. • lib/src/delegate/event_sink.dart:28:7 • return_of_invalid_type
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'Sink<T?>'. • lib/src/delegate/sink.dart:26:7 • return_of_invalid_type
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'StreamConsumer<T?>'. • lib/src/delegate/stream_consumer.dart:28:7 • return_of_invalid_type
error • A value of type 'Object' can't be returned from method 'typed' because it has a return type of 'StreamSink<T?>'. • lib/src/delegate/stream_sink.dart:31:7 • return_of_invalid_type
error • The return type 'ErrorResult' isn't a 'Result<T>', as required by the closure's context. • lib/src/result/result.dart:67:14 • return_of_invalid_type_from_closure
error • A value of type 'ErrorResult' can't be returned from function 'error' because it has a return type of 'Result<T>'. • lib/src/result/result.dart:80:7 • return_of_invalid_type
error • A value of type 'ErrorResult?' can't be returned from method 'flatten' because it has a return type of 'Result<T>?'. • lib/src/result/result.dart:176:12 • return_of_invalid_type
error • A value of type 'ErrorResult?' can't be returned from method 'flattenAll' because it has a return type of 'Result<List<T>>?'. • lib/src/result/result.dart:189:16 • return_of_invalid_type
error • The return type 'StreamTransformerWrapper<S, T>' of the redirected constructor isn't assignable to 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:27:46 • redirect_to_invalid_return_type
error • A value of type 'HandlerTransformer<S, T?>' can't be returned from function 'fromHandlers' because it has a return type of 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:40:12 • return_of_invalid_type
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:37:36 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:40:15 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:44:15 • unchecked_use_of_nullable_value
error • The argument type 'Stream<FutureOr<Stream<String>?>> Function()' can't be assigned to the parameter type 'Stream<String>? Function()'. • test/async_cache_test.dart:77:30 • argument_type_not_assignable
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:78:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:79:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:80:13 • yield_of_invalid_type
error • A value of type 'ErrorResult' can't be returned from function 'err' because it has a return type of 'Result<T>'. • test/result/result_flattenAll_test.dart:10:24 • return_of_invalid_type
error • A value of type 'ErrorResult' can't be assigned to a variable of type 'Result<bool>'. • test/result/result_test.dart:70:27 • invalid_assignment
error • A value of type 'ErrorResult' can't be assigned to a variable of type 'Result<bool>'. • test/result/result_test.dart:90:27 • invalid_assignment
error • A value of type 'ErrorResult' can't be assigned to a variable of type 'Result<bool>'. • test/result/result_test.dart:108:27 • invalid_assignment
error • A value of type 'CancelableOperation<Null>' can't be assigned to a variable of type 'CancelableOperation<Never>'. • test/stream_queue_test.dart:1100:46 • invalid_assignment
error • Couldn't infer type parameter 'S'.
Tried to infer 'Null' for 'S' which doesn't work:
Return type declared as 'CancelableOperation<S>?'
used where 'CancelableOperation<Never>?' is required.
Consider passing explicit type argument(s) to the generic.
• test/stream_queue_test.dart:1100:54 • could_not_infer
error • A value of type 'Null* Function()*' can't be assigned to a variable of type 'Never Function()'. • test/stream_zip_test.dart:257:29 • invalid_assignment
error • Couldn't infer type parameter 'T'.
Tried to infer 'Null' for 'T' which doesn't work:
Return type declared as 'T* Function()*'
used where 'Never Function()' is required.
Consider passing explicit type argument(s) to the generic.
• test/stream_zip_test.dart:257:29 • could_not_infer
error • This expression has a type of 'void' so its value can't be used. • test/subscription_stream_test.dart:68:12 • use_of_void_result
error • The argument type 'FutureOr<T>? Function()' can't be assigned to the parameter type 'FutureOr<T> Function()'. • lib/src/async_memoizer.dart:43:50 • argument_type_not_assignable
error • The argument type 'FutureOr<R>? Function()' can't be assigned to the parameter type 'FutureOr<R> Function()'. • lib/src/cancelable_operation.dart:102:42 • argument_type_not_assignable
error • The return type 'FutureOr<R>?' isn't a 'FutureOr<R>', as required by the closure's context. • lib/src/cancelable_operation.dart:110:48 • return_of_invalid_type_from_closure
These are all in the "what can we do" category. They all involve a migrated API like completer.complete(callback)
which accepts Future<T>
. And its given a callback that returns null in test code. So it seems like the callback should return Future<T>?
, because it does, its just that that's not allowed. And since its a callback, we can't just add a!
(though we could add a cast...and if we do, it will fail at runtime...) See #38707
Filed specifically as https://github.com/dart-lang/sdk/issues/40384
However, in addition to implementing that in the tool, ultimately this should be fixed in terms of refactoring the tests.
current situation is 25 errors and 1 warning
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:54:27 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:110:56 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:112:35 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/cancelable_operation.dart:195:28 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/future_group.dart:81:32 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/null_stream_sink.dart:52:29 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/result/result.dart:67:26 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/result/result.dart:89:25 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/stream_completer.dart:101:52 • argument_type_not_assignable
error • The argument type 'dynamic' can't be assigned to the parameter type 'Object'. • lib/src/stream_queue.dart:486:33 • argument_type_not_assignable
error • The return type 'StreamTransformerWrapper<S, T>' of the redirected constructor isn't assignable to 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:27:46 • redirect_to_invalid_return_type
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:37:37 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:40:15 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:44:15 • unchecked_use_of_nullable_value
error • The argument type 'Stream<FutureOr<Stream<String>?>> Function()' can't be assigned to the parameter type 'Stream<String>? Function()'. • test/async_cache_test.dart:77:30 • argument_type_not_assignable
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:78:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:79:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:80:13 • yield_of_invalid_type
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:147:19 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:150:19 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:184:19 • invalid_assignment
error • A value of type 'dynamic' can't be assigned to a variable of type 'Object'. • test/stream_completer_test.dart:187:19 • invalid_assignment
error • The expression is nullable and must be null-checked before it can be used. • test/stream_sink_transformer_test.dart:22:18 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • test/stream_sink_transformer_test.dart:121:18 • unchecked_use_of_nullable_value
error • This expression has a type of 'void' so its value can't be used. • test/subscription_stream_test.dart:68:12 • use_of_void_result
warning • The left operand can't be null, so the right operand is never executed. • lib/src/null_stream_sink.dart:73:50 • dead_null_coalesce
With downcasts from dynamic reenabled, we get 11 errors and 1 warning.
error • The return type 'StreamTransformerWrapper<S, T>' of the redirected constructor isn't assignable to 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:27:46 • redirect_to_invalid_return_type
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:37:37 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:40:15 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • lib/src/stream_subscription_transformer.dart:44:15 • unchecked_use_of_nullable_value
error • The argument type 'Stream<FutureOr<Stream<String>?>> Function()' can't be assigned to the parameter type 'Stream<String>? Function()'. • test/async_cache_test.dart:77:30 • argument_type_not_assignable
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:78:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:79:13 • yield_of_invalid_type
error • The type 'Stream<String>' implied by the 'yield' expression must be assignable to 'Stream<FutureOr<Stream<String>?>>'. • test/async_cache_test.dart:80:13 • yield_of_invalid_type
error • The expression is nullable and must be null-checked before it can be used. • test/stream_sink_transformer_test.dart:22:18 • unchecked_use_of_nullable_value
error • The expression is nullable and must be null-checked before it can be used. • test/stream_sink_transformer_test.dart:121:18 • unchecked_use_of_nullable_value
error • This expression has a type of 'void' so its value can't be used. • test/subscription_stream_test.dart:68:12 • use_of_void_result
warning • The left operand can't be null, so the right operand is never executed. • lib/src/null_stream_sink.dart:73:50 • dead_null_coalesce
error • The return type 'StreamTransformerWrapper<S, T>' of the redirected constructor isn't assignable to 'StreamSinkTransformer<S, T>'. • lib/src/stream_sink_transformer.dart:27:46 • redirect_to_invalid_return_type
is caused be https://github.com/dart-lang/sdk/issues/40551
Since package:async has now been migrated, we should use a different target for continued work.