Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit d598504

Browse files
committed
Fix fuzzy arrow warning in lib/testing.dart.
Context: dart-lang/sdk#29630 I also fixed a few places to use the real generic method syntax while I was at it. I bumped the version to 0.2.0-dev since my change is technically breaking -- it changes the return type of TestStdinAsync.controller. If you don't feel that will actually break any real users, I can do 0.1.5-dev instead. This needs to roll into Google after I land it. If you'd like me to publish this, let me know and I'll do 0.1.5 instead.
1 parent d28530d commit d598504

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.2.0
2+
3+
* Change TestStdinAsync.controller to StreamController<List<int>> (instead of
4+
using dynamic as the type argument).
5+
16
## 0.1.4
27

38
* Added `BazelWorkerDriver` class, which can be used to implement the bazel side

lib/testing.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class TestStdinSync implements TestStdin {
5050
/// Note: You must call [close] in order for the loop to exit properly.
5151
class TestStdinAsync implements TestStdin {
5252
/// Controls the stream for async delivery of bytes.
53-
final StreamController _controller = new StreamController();
54-
StreamController get controller => _controller;
53+
final StreamController<List<int>> _controller = new StreamController();
54+
StreamController<List<int>> get controller => _controller;
5555

5656
/// Adds all the [bytes] to this stream.
5757
void addInputBytes(List<int> bytes) {
@@ -67,9 +67,7 @@ class TestStdinAsync implements TestStdin {
6767
StreamSubscription<List<int>> listen(onData(List<int> bytes),
6868
{Function onError, void onDone(), bool cancelOnError}) {
6969
return _controller.stream.listen(onData,
70-
onError: onError,
71-
onDone: onDone,
72-
cancelOnError: cancelOnError) as StreamSubscription<List<int>>;
70+
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
7371
}
7472

7573
@override

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: bazel_worker
2-
version: 0.1.4
2+
version: 0.2.0-dev
33
description: Tools for creating a bazel persistent worker.
44
author: Dart Team <[email protected]>
55
homepage: https://github.com/dart-lang/bazel_worker

test/worker_loop_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ void main() {
4848
});
4949
}
5050

51-
void runTests/*<T extends TestWorkerConnection>*/(
51+
void runTests<T extends TestWorkerConnection>(
5252
TestStdin stdinFactory(),
53-
/*=T*/ workerConnectionFactory(Stdin stdin, Stdout stdout),
54-
TestWorkerLoop workerLoopFactory(/*=T*/ connection)) {
53+
T workerConnectionFactory(Stdin stdin, Stdout stdout),
54+
TestWorkerLoop workerLoopFactory(T connection)) {
5555
TestStdin stdinStream;
5656
TestStdoutStream stdoutStream;
57-
var/*=T*/ connection;
57+
T connection;
5858
TestWorkerLoop workerLoop;
5959

6060
setUp(() {

0 commit comments

Comments
 (0)