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

Unified Diff: tests/language/generic_methods_type_expression_test.dart

Issue 3001803002: Migrate block 114 (and some of 113). (Closed)
Patch Set: Tweak app_jit status. Created 3 years, 4 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/generic_methods_test.dart ('k') | tests/language/generic_native_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/generic_methods_type_expression_test.dart
diff --git a/tests/language/generic_methods_type_expression_test.dart b/tests/language/generic_methods_type_expression_test.dart
deleted file mode 100644
index 34988d4bf8b6f0f3571da019f6d12658b52e3e78..0000000000000000000000000000000000000000
--- a/tests/language/generic_methods_type_expression_test.dart
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2016, 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.
-//
-// VMOptions=--generic-method-syntax
-
-/// Dart test on the usage of method type arguments in type expressions. With
-/// '--generic-method-syntax', the type argument is available at runtime,
-/// but erased to `dynamic`.
-
-library generic_methods_type_expression_test;
-
-import "package:expect/expect.dart";
-
-bool f1<T>(Object o) => o is T; // //# 01: static type warning
-
-bool f2<T>(Object o) => o is List<T>;
-
-bool f3<T>(Object o) => o is! T; // //# 03: static type warning
-
-bool f4<T>(Object o) => o is! List<T>;
-
-T f5<T>(Object o) => o as T;
-
-List<T> f6<T>(Object o) => o as List<T>;
-
-Type f7<T>() => T;
-
-class TypeValue<X> {
- Type get value => X;
-}
-
-Type f8<T>() => new TypeValue<List<T>>().value;
-
-bool f9<T>(Object o) => o is Map<T, String>;
-
-class IsMap<A> {
- @NoInline()
- bool check<B>(o) => o is Map<A, B>;
-}
-
-main() {
- String s = "Hello!";
- List<String> ss = <String>[s];
- Expect.throws(() => f1<int>(42), (e) => e is TypeError); // //# 01: continued
- Expect.throws(() => f1<String>(42), (e) => e is TypeError); // //# 01: continued
- Expect.equals(f2<int>(<int>[42]), true);
- Expect.equals(f2<String>(<int>[42]), true); // `is List<dynamic>` is true.
- Expect.throws(() => f3<int>(42), (e) => e is TypeError); // //# 03: continued
- Expect.throws(() => f3<String>(42), (e) => e is TypeError); // //# 03: continued
- Expect.equals(f4<int>(<int>[42]), false);
- Expect.equals(f4<String>(<int>[42]), false); // `is! List<dynamic>` is false.
- Expect.equals(f5<String>(s), s); // `s as dynamic == s`
- Expect.equals(f5<int>(s), s); // `s as dynamic == s`
- Expect.equals(f6<String>(ss), ss);
- Expect.equals(f6<int>(ss), ss); // `as List<dynamic>` succeeds.
- Expect.throws(() => f7<int>(), (e) => e is TypeError);
- Expect.equals(f8<int>(), List); // Returns `List<dynamic>`.
-
- Expect.isTrue(f9<int>(<int, String>{}));
- Expect
- .isTrue(f9<int>(<bool, String>{})); // `is Map<dynamic, String>` is true.
- Expect.isFalse(f9<int>(<int, int>{}));
-
- Expect.isTrue(new IsMap<int>().check<String>(<int, String>{}));
- Expect.isTrue(new IsMap<int>().check<int>(<int, String>{}));
-}
« no previous file with comments | « tests/language/generic_methods_test.dart ('k') | tests/language/generic_native_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698