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>); |
} |