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

Side by Side Diff: lib/src/delegate/stream.dart

Issue 2660333005: Change generic comment syntax to real generic syntax. (Closed)
Patch Set: Update version. Created 3 years, 10 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/delegate/sink.dart ('k') | lib/src/delegate/stream_consumer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import '../typed/stream.dart'; 7 import '../typed/stream.dart';
8 8
9 /// Simple delegating wrapper around a [Stream]. 9 /// Simple delegating wrapper around a [Stream].
10 /// 10 ///
11 /// Subclasses can override individual methods, or use this to expose only the 11 /// Subclasses can override individual methods, or use this to expose only the
12 /// [Stream] methods of a subclass. 12 /// [Stream] methods of a subclass.
13 /// 13 ///
14 /// Note that this is identical to [StreamView] in `dart:async`. It's provided 14 /// Note that this is identical to [StreamView] in `dart:async`. It's provided
15 /// under this name for consistency with other `Delegating*` classes. 15 /// under this name for consistency with other `Delegating*` classes.
16 class DelegatingStream<T> extends StreamView<T> { 16 class DelegatingStream<T> extends StreamView<T> {
17 DelegatingStream(Stream<T> stream) : super(stream); 17 DelegatingStream(Stream<T> stream) : super(stream);
18 18
19 /// Creates a wrapper which throws if [stream]'s events aren't instances of 19 /// Creates a wrapper which throws if [stream]'s events aren't instances of
20 /// `T`. 20 /// `T`.
21 /// 21 ///
22 /// This soundly converts a [Stream] to a `Stream<T>`, regardless of its 22 /// This soundly converts a [Stream] to a `Stream<T>`, regardless of its
23 /// original generic type, by asserting that its events are instances of `T` 23 /// original generic type, by asserting that its events are instances of `T`
24 /// whenever they're provided. If they're not, the stream throws a 24 /// whenever they're provided. If they're not, the stream throws a
25 /// [CastError]. 25 /// [CastError].
26 static Stream/*<T>*/ typed/*<T>*/(Stream stream) => 26 static Stream<T> typed<T>(Stream stream) =>
27 stream is Stream/*<T>*/ ? stream : new TypeSafeStream/*<T>*/(stream); 27 stream is Stream<T> ? stream : new TypeSafeStream<T>(stream);
28 } 28 }
OLDNEW
« no previous file with comments | « lib/src/delegate/sink.dart ('k') | lib/src/delegate/stream_consumer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698