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

Unified Diff: tests/language/generic_methods_type_expression_test.dart

Issue 2000223002: Revert "Adjusts dart2js backend to handle method type arguments." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
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 cbe08026c4f5fb7743a57f4c3e6910d5097ae462..0000000000000000000000000000000000000000
--- a/tests/language/generic_methods_type_expression_test.dart
+++ /dev/null
@@ -1,52 +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.
-//
-// DartOptions=--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;
-
-bool f2<T>(Object o) => o is List<T>;
-
-bool f3<T>(Object o) => o is! T;
-
-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;
-
-main() {
- String s = "Hello!";
- List<String> ss = <String>[s];
- Expect.throws(() => f1<int>(42), (e) => e is TypeError);
- Expect.throws(() => f1<String>(42), (e) => e is TypeError);
- 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);
- Expect.throws(() => f3<String>(42), (e) => e is TypeError);
- Expect.equals(f4<int>(<int>[42]), false);
- Expect.equals(f4<String>(<int>[42]), false); // `is! List<dynamic>` is false.
- Expect.throws(() => f5<String>(s), (e) => e is TypeError);
- Expect.throws(() => f5<int>(s), (e) => e is TypeError);
- 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>`.
-}
« no previous file with comments | « tests/language/generic_methods_new_test.options ('k') | tests/language/generic_methods_type_expression_test.options » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698