Fix runtime cast failure in chainForTrace(). See: https://github.com/dart-lang/sdk/issues/27223
diff --git a/pkgs/stack_trace/CHANGELOG.md b/pkgs/stack_trace/CHANGELOG.md index 2627e71..3c6e56c 100644 --- a/pkgs/stack_trace/CHANGELOG.md +++ b/pkgs/stack_trace/CHANGELOG.md
@@ -1,4 +1,9 @@ +## 1.9.1+1 + +* Fix Dart 2.0 runtime cast failure in test. + ## 1.9.1 + * Preserve the original chain for a trace to handle cases where an error is rethrown.
diff --git a/pkgs/stack_trace/pubspec.yaml b/pkgs/stack_trace/pubspec.yaml index f7c562d..93ffeb3 100644 --- a/pkgs/stack_trace/pubspec.yaml +++ b/pkgs/stack_trace/pubspec.yaml
@@ -7,7 +7,7 @@ # # When the major version is upgraded, you *must* update that version constraint # in pub to stay in sync with this. -version: 1.9.1 +version: 1.9.1+1 author: "Dart Team <misc@dartlang.org>" homepage: https://github.com/dart-lang/stack_trace description: A package for manipulating stack traces and printing them readably.
diff --git a/pkgs/stack_trace/test/chain/utils.dart b/pkgs/stack_trace/test/chain/utils.dart index bf82158..0c5c983 100644 --- a/pkgs/stack_trace/test/chain/utils.dart +++ b/pkgs/stack_trace/test/chain/utils.dart
@@ -64,7 +64,7 @@ /// Runs [callback] within [asyncFn], then converts any errors raised into a /// [Chain] with [Chain.forTrace]. Future<Chain> chainForTrace(asyncFn(callback()), callback()) { - var completer = new Completer(); + var completer = new Completer<Chain>(); asyncFn(() { // We use `new Future.value().then(...)` here as opposed to [new Future] or // [new Future.sync] because those methods don't pass the exception through @@ -75,10 +75,8 @@ .catchError(completer.completeError); }); - // TODO(rnystrom): Remove this cast if catchError() gets a better type. return completer.future - .catchError((_, stackTrace) => new Chain.forTrace(stackTrace)) - as Future<Chain>; + .catchError((_, stackTrace) => new Chain.forTrace(stackTrace)); } /// Runs [callback] in a [Chain.capture] zone and returns a Future that