diff --git a/CHANGELOG.md b/CHANGELOG.md index 093a2421d5afc..4813e9a1fe0ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.6.5 + +* Fix an issue with `JsonDocumentTransformer.bind` where it created an internal + stream channel which didn't get a properly inferred type for its `sink`. + ## 1.6.4 * Fix a race condition in `MultiChannel` where messages from a remote virtual diff --git a/lib/src/json_document_transformer.dart b/lib/src/json_document_transformer.dart index 86b9ae71c34b9..533d2382397e5 100644 --- a/lib/src/json_document_transformer.dart +++ b/lib/src/json_document_transformer.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:async'; import 'dart:convert'; import 'package:async/async.dart'; @@ -35,9 +36,10 @@ class JsonDocumentTransformer JsonDocumentTransformer._(this._codec); - StreamChannel bind(StreamChannel channel) { + StreamChannel bind(StreamChannel channel) { var stream = channel.stream.map(_codec.decode); - var sink = new StreamSinkTransformer.fromHandlers(handleData: (data, sink) { + var sink = new StreamSinkTransformer.fromHandlers( + handleData: (data, sink) { sink.add(_codec.encode(data)); }).bind(channel.sink); return new StreamChannel.withCloseGuarantee(stream, sink); diff --git a/pubspec.yaml b/pubspec.yaml index 393e60f3b61f3..9221866dc5713 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: stream_channel -version: 1.6.4 +version: 1.6.5 description: An abstraction for two-way communication channels. author: Dart Team homepage: https://github.com/dart-lang/stream_channel