 Chromium Code Reviews
 Chromium Code Reviews Issue 1841223002:
  Fix most strong mode warnings.  (Closed) 
  Base URL: git@github.com:dart-lang/async.git@master
    
  
    Issue 1841223002:
  Fix most strong mode warnings.  (Closed) 
  Base URL: git@github.com:dart-lang/async.git@master| 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> { | 
| 
Lasse Reichstein Nielsen
2016/03/29 21:53:59
I really dislike adding <T> here - it's completely
 
nweiz
2016/03/30 00:57:18
I understand the logic behind this being a Result<
 | 
| 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); | 
| 
Lasse Reichstein Nielsen
2016/03/29 21:53:59
Should this be  new Future<T>.error ?
(Then, at le
 
nweiz
2016/03/30 00:57:18
That's inferred via downward inference.
 
Lasse Reichstein Nielsen
2016/03/30 16:00:18
That doesn't work in the VM or pure Dart.
This co
 
nweiz
2016/03/30 19:11:54
I'm not sure what you mean by "pure Dart", but thi
 | 
| /// Calls an error handler with the error and stacktrace. | 
| /// |