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

Unified Diff: tests/language/generic_methods_type_expression_test.dart

Issue 2650823003: Fix generic function tests to satisfy analyzer (fixes #27728). (Closed)
Patch Set: Created 3 years, 11 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
index ccf24bc3a067e74a5631ad0c8f04c259e3e321fb..4597370b03cabed68289c6dc3e3ec488f47b00b4 100644
--- a/tests/language/generic_methods_type_expression_test.dart
+++ b/tests/language/generic_methods_type_expression_test.dart
@@ -12,11 +12,11 @@ library generic_methods_type_expression_test;
import "package:expect/expect.dart";
-bool f1<T>(Object o) => o is T;
+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;
+bool f3<T>(Object o) => o is! T; /// 03: static type warning
bool f4<T>(Object o) => o is! List<T>;
@@ -42,12 +42,12 @@ class IsMap<A> {
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.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);
- Expect.throws(() => f3<String>(42), (e) => e is TypeError);
+ 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`
« no previous file with comments | « tests/language/generic_methods_generic_function_parameter_test.dart ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698