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

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

Issue 1841223002: Fix most strong mode warnings. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Code review changes Created 4 years, 9 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
« no previous file with comments | « lib/src/result/capture_transformer.dart ('k') | lib/src/result/future.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/result/error.dart
diff --git a/lib/src/result/error.dart b/lib/src/result/error.dart
index eecf68e450c873cfee8aac7a019dde4bc6c7f871..b6d585937f520f736cd77d322945bb6796722649 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 implements Result {
+class ErrorResult<T> implements Result<T> {
final error;
final StackTrace stackTrace;
bool get isValue => false;
bool get isError => true;
- ValueResult get asValue => null;
- ErrorResult get asError => this;
+ ValueResult<T> get asValue => null;
+ ErrorResult<T> get asError => this;
ErrorResult(this.error, this.stackTrace);
@@ -27,7 +27,7 @@ class ErrorResult implements Result {
sink.addError(error, stackTrace);
}
- Future get asFuture => new Future.error(error, stackTrace);
+ Future<T> get asFuture => new Future.error(error, stackTrace);
/// Calls an error handler with the error and stacktrace.
///
« no previous file with comments | « lib/src/result/capture_transformer.dart ('k') | lib/src/result/future.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698