Fix fuzzy arrow warning in lib/testing.dart. (#12)
Context: https://github.com/dart-lang/sdk/issues/29630
- fixes a few places to use the real generic method syntax
- bumps version to 0.1.5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7878fb7..94cfb08 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.1.5
+
+* Change TestStdinAsync.controller to StreamController<List<int>> (instead of
+ using dynamic as the type argument).
+
## 0.1.4
* Added `BazelWorkerDriver` class, which can be used to implement the bazel side
diff --git a/lib/testing.dart b/lib/testing.dart
index 1afd231..a8b66c1 100644
--- a/lib/testing.dart
+++ b/lib/testing.dart
@@ -50,8 +50,8 @@
/// Note: You must call [close] in order for the loop to exit properly.
class TestStdinAsync implements TestStdin {
/// Controls the stream for async delivery of bytes.
- final StreamController _controller = new StreamController();
- StreamController get controller => _controller;
+ final StreamController<List<int>> _controller = new StreamController();
+ StreamController<List<int>> get controller => _controller;
/// Adds all the [bytes] to this stream.
void addInputBytes(List<int> bytes) {
@@ -67,9 +67,7 @@
StreamSubscription<List<int>> listen(onData(List<int> bytes),
{Function onError, void onDone(), bool cancelOnError}) {
return _controller.stream.listen(onData,
- onError: onError,
- onDone: onDone,
- cancelOnError: cancelOnError) as StreamSubscription<List<int>>;
+ onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}
@override
diff --git a/pubspec.yaml b/pubspec.yaml
index 9f88507..0c1db7c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: bazel_worker
-version: 0.1.4
+version: 0.1.5
description: Tools for creating a bazel persistent worker.
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/bazel_worker
diff --git a/test/worker_loop_test.dart b/test/worker_loop_test.dart
index 1ef2845..2356060 100644
--- a/test/worker_loop_test.dart
+++ b/test/worker_loop_test.dart
@@ -48,13 +48,13 @@
});
}
-void runTests/*<T extends TestWorkerConnection>*/(
+void runTests<T extends TestWorkerConnection>(
TestStdin stdinFactory(),
- /*=T*/ workerConnectionFactory(Stdin stdin, Stdout stdout),
- TestWorkerLoop workerLoopFactory(/*=T*/ connection)) {
+ T workerConnectionFactory(Stdin stdin, Stdout stdout),
+ TestWorkerLoop workerLoopFactory(T connection)) {
TestStdin stdinStream;
TestStdoutStream stdoutStream;
- var/*=T*/ connection;
+ T connection;
TestWorkerLoop workerLoop;
setUp(() {