Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: lib/src/stream_sink_transformer/typed.dart

Issue 1947923003: Add APIs for asserting the types of transformers. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Code review changes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/src/stream_sink_transformer.dart ('k') | lib/src/typed_stream_transformer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6
7 import '../delegate/stream_sink.dart';
8 import '../stream_sink_transformer.dart';
9
10 /// A wrapper that coerces the generic type of the sink returned by an inner
11 /// transformer to `S`.
12 class TypeSafeStreamSinkTransformer<S, T>
13 implements StreamSinkTransformer<S, T> {
14 final StreamSinkTransformer _inner;
15
16 TypeSafeStreamSinkTransformer(this._inner);
17
18 StreamSink<S> bind(StreamSink<T> sink) =>
19 DelegatingStreamSink.typed(_inner.bind(sink));
20 }
OLDNEW
« no previous file with comments | « lib/src/stream_sink_transformer.dart ('k') | lib/src/typed_stream_transformer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698