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

Unified Diff: lib/src/result/error.dart

Issue 2996143002: Add methods to Result. Bump version to 2.0 and remove deprecated features. (Closed)
Patch Set: Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: lib/src/result/error.dart
diff --git a/lib/src/result/error.dart b/lib/src/result/error.dart
index b6d585937f520f736cd77d322945bb6796722649..77fa9c62d8b18f364af3cbd953c45551d222e727 100644
--- a/lib/src/result/error.dart
+++ b/lib/src/result/error.dart
@@ -8,14 +8,14 @@ import '../result.dart';
import 'value.dart';
/// A result representing a thrown error.
-class ErrorResult<T> implements Result<T> {
+class ErrorResult implements Result<Null> {
final error;
final StackTrace stackTrace;
bool get isValue => false;
bool get isError => true;
- ValueResult<T> get asValue => null;
- ErrorResult<T> get asError => this;
+ ValueResult<Null> get asValue => null;
+ ErrorResult<Null> get asError => this;
ErrorResult(this.error, this.stackTrace);
@@ -27,7 +27,7 @@ class ErrorResult<T> implements Result<T> {
sink.addError(error, stackTrace);
}
- Future<T> get asFuture => new Future.error(error, stackTrace);
+ Future<Null> get asFuture => new Future<Null>.error(error, stackTrace);
/// Calls an error handler with the error and stacktrace.
///

Powered by Google App Engine
This is Rietveld 408576698