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

Unified Diff: tests/language/type_variable_scope2_test.dart

Issue 19097003: Support new malformed types semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix unittests. Created 7 years, 5 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 | « tests/language/type_variable_bounds_test.dart ('k') | tests/language/type_variable_scope_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_variable_scope2_test.dart
diff --git a/tests/language/type_variable_scope2_test.dart b/tests/language/type_variable_scope2_test.dart
index 569daee6b7329c2761275563a1d2b684d8fd8d65..2a008f95843951fc91baf419a58e680f43a431f7 100644
--- a/tests/language/type_variable_scope2_test.dart
+++ b/tests/language/type_variable_scope2_test.dart
@@ -4,17 +4,8 @@
import "package:expect/expect.dart";
-// Test that malformed type arguments are reported in checked mode.
-
-isCheckedMode() {
- try {
- var i = 1;
- String s = i;
- return false;
- } catch (e) {
- return true;
- }
-}
+// Test that malformed type arguments treated as dynamic in both production and
+// checked mode.
class Foo<T> {
// T is not in scope for a static method.
@@ -24,13 +15,11 @@ class Foo<T> {
}
main() {
- bool got_type_error = false;
try {
Expect.isTrue(Foo.m() is Foo);
} on TypeError catch (error) {
print(error);
- got_type_error = true;
+ // No type error in production nor checked mode.
+ Expect.fail();
}
- // Type error in checked mode only.
- Expect.isTrue(got_type_error == isCheckedMode());
}
« no previous file with comments | « tests/language/type_variable_bounds_test.dart ('k') | tests/language/type_variable_scope_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698