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

Unified Diff: tests/language/function_malformed_result_type_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/compiler/dart2js/resolver_test.dart ('k') | tests/language/is_not_class2_negative_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/function_malformed_result_type_test.dart
diff --git a/tests/language/function_malformed_result_type_test.dart b/tests/language/function_malformed_result_type_test.dart
index d010be7ba0cfe17afc5a69e91020819db3c4b933..2895975348edb7f995ce69a83884e829a00ec57d 100644
--- a/tests/language/function_malformed_result_type_test.dart
+++ b/tests/language/function_malformed_result_type_test.dart
@@ -1,22 +1,13 @@
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// 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.
+
// Dart test for a function with a malformed result type.
import "package:expect/expect.dart";
class C<T, U> {}
-isCheckedMode() {
- try {
- var i = 1;
- String s = i;
- return false;
- } catch (e) {
- return true;
- }
-}
-
main() {
{
C<int> f() => null;
@@ -37,7 +28,8 @@ main() {
} on TypeError catch (error) {
got_type_error = true;
}
- // Type error expected in checked mode only.
- Expect.isTrue(got_type_error == isCheckedMode());
+ // Type error not expected in production nor checked mode since C<int>
+ // is handled like C<dynamic,dynamic>.
+ Expect.isFalse(got_type_error);
}
}
« no previous file with comments | « tests/compiler/dart2js/resolver_test.dart ('k') | tests/language/is_not_class2_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698