Merge pull request #38 from dart-lang/cast-failure
Fix runtime cast failure in chainForTrace().
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2627e71..a2a4c44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,9 @@
+## 1.9.2
+
+* 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/pubspec.yaml b/pubspec.yaml
index f7c562d..3824d64 100644
--- a/pubspec.yaml
+++ b/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.2
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/test/chain/utils.dart b/test/chain/utils.dart
index bf82158..0c5c983 100644
--- a/test/chain/utils.dart
+++ b/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