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

Unified Diff: tests/language/regress_23650_test.dart

Issue 1188103002: Do not mark type variables as needing a box inside try; they are immutable. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/regress_23650_test.dart
diff --git a/tests/language/regress_22438_test.dart b/tests/language/regress_23650_test.dart
similarity index 54%
copy from tests/language/regress_22438_test.dart
copy to tests/language/regress_23650_test.dart
index 8ff362b8680f5399100109e5ae2f62614ecae0ba..2beb67b5b1cad31dc246d2a4a31e48db7fab5c95 100644
--- a/tests/language/regress_22438_test.dart
+++ b/tests/language/regress_23650_test.dart
@@ -2,18 +2,22 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import "dart:async";
+// Test that type variables in try-catch work.
+
import "package:expect/expect.dart";
-main() async {
- var error = "no error";
- try {
+class C<T> {
+ C.foo();
+ factory C() {
try {
- await new Future.error("error");
- } on MissingType catch(e) {
+ return new C<T>.foo();
+ } finally {
}
- } catch (e) {
- error = e;
}
- Expect.isTrue(error is TypeError);
+}
+
+main() {
+ var c = new C<int>();
+ Expect.isTrue(c is C<int>);
+ Expect.isFalse(c is C<String>);
}
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698