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

Commit cccc8aa

Browse files
authored
Resolve null safety migration TODOS (#135)
- Switch from `StackTrace.fromString` to `AsyncError.defaultStackTrace`. - Remove a TODO about non-nullable `StackTrace`, by the time we merged null safety the type was already non-nullable and the TODO was stale. Style tweak - remove the argument names from a Function type that are redundant against their type names.
1 parent ab56d82 commit cccc8aa

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/src/result/error.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ class ErrorResult implements Result<Never> {
2525
ErrorResult get asError => this;
2626

2727
ErrorResult(this.error, [StackTrace? stackTrace])
28-
// TODO: Use AsyncError.defaultStackTrace(error) once available
29-
: stackTrace = stackTrace ?? StackTrace.fromString('');
28+
: stackTrace = stackTrace ?? AsyncError.defaultStackTrace(error);
3029

3130
@override
3231
void complete(Completer completer) {

lib/src/stream_sink_transformer/handler_transformer.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ import '../delegate/stream_sink.dart';
1111
typedef HandleData<S, T> = void Function(S data, EventSink<T> sink);
1212

1313
/// The type of the callback for handling error events.
14-
//
15-
// TODO: Update to take a non-nullable StackTrace once that change lands in
16-
// the sdk.
17-
typedef HandleError<T> = void Function(
18-
Object error, StackTrace stackTrace, EventSink<T> sink);
14+
typedef HandleError<T> = void Function(Object error, StackTrace, EventSink<T>);
1915

2016
/// The type of the callback for handling done events.
2117
typedef HandleDone<T> = void Function(EventSink<T> sink);

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