Skip to content
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

Fix a remaining Dart 2 issue #23

Merged
merged 1 commit into from
May 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## 1.6.6

* Fix a Dart2 issue with inner stream transformation in `GuaranteeChannel`.
* Fix a Dart 2 issue with inner stream transformation in `GuaranteeChannel`.

* Fix a Dart 2 issue with `StreamChannelTransformer.fromCodec()`.

## 1.6.5

Expand Down
7 changes: 2 additions & 5 deletions lib/src/stream_channel_transformer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ class StreamChannelTransformer<S, T> {
/// All input to the inner channel's sink is encoded using [Codec.encoder],
/// and all output from its stream is decoded using [Codec.decoder].
StreamChannelTransformer.fromCodec(Codec<S, T> codec)
: this(
typedStreamTransformer(codec.decoder),
StreamSinkTransformer.typed(
new StreamSinkTransformer.fromStreamTransformer(
codec.encoder)));
: this(codec.decoder,
new StreamSinkTransformer.fromStreamTransformer(codec.encoder));

/// Transforms the events sent to and emitted by [channel].
///
Expand Down
5 changes: 3 additions & 2 deletions test/stream_channel_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ void main() {
});

test("transform() transforms the channel", () async {
var transformed =
channel.transform(new StreamChannelTransformer.fromCodec(UTF8));
var transformed = channel
.cast<List<int>>()
.transform(new StreamChannelTransformer.fromCodec(UTF8));

streamController.add([102, 111, 111, 98, 97, 114]);
streamController.close();
Expand Down