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

Commit 3fedad2

Browse files
authored
Remove references to the deprecated CastError. (#118)
1 parent 9aca508 commit 3fedad2

11 files changed

+14
-14
lines changed

lib/src/delegate/event_sink.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DelegatingEventSink<T> implements EventSink<T> {
2020
///
2121
/// Unlike [new DelegatingEventSink], this only requires its argument to be an
2222
/// instance of `EventSink`, not `EventSink<T>`. This means that calls to
23-
/// [add] may throw a [CastError] if the argument type doesn't match the
23+
/// [add] may throw a [TypeError] if the argument type doesn't match the
2424
/// reified type of [sink].
2525
@Deprecated(
2626
'Use StreamController<T>(sync: true)..stream.cast<S>().pipe(sink)')

lib/src/delegate/future.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DelegatingFuture<T> implements Future<T> {
1616
///
1717
/// This soundly converts a [Future] to a `Future<T>`, regardless of its
1818
/// original generic type, by asserting that its value is an instance of `T`
19-
/// whenever it's provided. If it's not, the future throws a [CastError].
19+
/// whenever it's provided. If it's not, the future throws a [TypeError].
2020
@Deprecated('Use future.then((v) => v as T) instead.')
2121
static Future<T> typed<T>(Future future) =>
2222
future is Future<T> ? future : future.then((v) => v as T);

lib/src/delegate/sink.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DelegatingSink<T> implements Sink<T> {
1818
///
1919
/// Unlike [new DelegatingSink], this only requires its argument to be an
2020
/// instance of `Sink`, not `Sink<T>`. This means that calls to [add] may
21-
/// throw a [CastError] if the argument type doesn't match the reified type of
21+
/// throw a [TypeError] if the argument type doesn't match the reified type of
2222
/// [sink].
2323
@Deprecated(
2424
'Use StreamController<T>(sync: true)..stream.cast<S>().pipe(sink)')

lib/src/delegate/stream.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DelegatingStream<T> extends StreamView<T> {
2020
/// This soundly converts a [Stream] to a `Stream<T>`, regardless of its
2121
/// original generic type, by asserting that its events are instances of `T`
2222
/// whenever they're provided. If they're not, the stream throws a
23-
/// [CastError].
23+
/// [TypeError].
2424
@Deprecated('Use stream.cast instead')
2525
static Stream<T> typed<T>(Stream stream) => stream.cast();
2626
}

lib/src/delegate/stream_consumer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class DelegatingStreamConsumer<T> implements StreamConsumer<T> {
2020
///
2121
/// Unlike [new StreamConsumer], this only requires its argument to be an
2222
/// instance of `StreamConsumer`, not `StreamConsumer<T>`. This means that
23-
/// calls to [addStream] may throw a [CastError] if the argument type doesn't
23+
/// calls to [addStream] may throw a [TypeError] if the argument type doesn't
2424
/// match the reified type of [consumer].
2525
@Deprecated(
2626
'Use StreamController<T>(sync: true)..stream.cast<S>().pipe(sink)')

lib/src/delegate/stream_sink.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class DelegatingStreamSink<T> implements StreamSink<T> {
2323
///
2424
/// Unlike [new StreamSink], this only requires its argument to be an instance
2525
/// of `StreamSink`, not `StreamSink<T>`. This means that calls to [add] may
26-
/// throw a [CastError] if the argument type doesn't match the reified type of
26+
/// throw a [TypeError] if the argument type doesn't match the reified type of
2727
/// [sink].
2828
@Deprecated(
2929
'Use StreamController<T>(sync: true)..stream.cast<S>().pipe(sink)')

lib/src/delegate/stream_subscription.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DelegatingStreamSubscription<T> implements StreamSubscription<T> {
2222
/// This soundly converts a [StreamSubscription] to a `StreamSubscription<T>`,
2323
/// regardless of its original generic type, by asserting that its events are
2424
/// instances of `T` whenever they're provided. If they're not, the
25-
/// subscription throws a [CastError].
25+
/// subscription throws a [TypeError].
2626
@Deprecated('Use Stream.cast instead')
2727
// TODO - Remove `TypeSafeStreamSubscription` and tests when removing this.
2828
static StreamSubscription<T> typed<T>(StreamSubscription subscription) =>

lib/src/stream_sink_transformer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ abstract class StreamSinkTransformer<S, T> {
5151
/// This soundly converts a [StreamSinkTransformer] to a
5252
/// `StreamSinkTransformer<S, T>`, regardless of its original generic type.
5353
/// This means that calls to [StreamSink.add] on the returned sink may throw a
54-
/// [CastError] if the argument type doesn't match the reified type of the
54+
/// [TypeError] if the argument type doesn't match the reified type of the
5555
/// sink.
5656
@deprecated
5757
// TODO remove TypeSafeStreamSinkTransformer

lib/src/typed_stream_transformer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:async';
99
/// This soundly converts a [StreamTransformer] to a `StreamTransformer<S, T>`,
1010
/// regardless of its original generic type, by asserting that the events
1111
/// emitted by the transformed stream are instances of `T` whenever they're
12-
/// provided. If they're not, the stream throws a [CastError].
12+
/// provided. If they're not, the stream throws a [TypeError].
1313
@Deprecated('Use Stream.cast after binding a transformer instead')
1414
StreamTransformer<S, T> typedStreamTransformer<S, T>(
1515
StreamTransformer transformer) =>

test/typed_wrapper/stream_subscription_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void main() {
7979
wrapper = TypeSafeStreamSubscription<int>(controller.stream.listen(null));
8080
});
8181

82-
group('throws a CastError for', () {
82+
group('throws a TypeError for', () {
8383
test('onData()', () {
8484
expect(() {
8585
// TODO(nweiz): Use the wrapper declared in setUp when sdk#26226 is
@@ -90,11 +90,11 @@ void main() {
9090

9191
wrapper.onData(expectAsync1((_) {}, count: 0));
9292
controller.add('foo');
93-
}, throwsZonedCastError);
93+
}, throwsZonedTypeError);
9494
});
9595
});
9696

97-
group("doesn't throw a CastError for", () {
97+
group("doesn't throw a TypeError for", () {
9898
test('onError()', () {
9999
wrapper.onError(expectAsync1((error) {
100100
expect(error, equals('oh no'));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy