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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 2540903003: restrict generic function type subtyping (Closed)
Patch Set: patch Created 4 years 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 | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 79798808ad6ae847a1a0e2906bf8fb5c657e042d..db3982841f56db273edf3fb623de64a379bc1fd9 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2263,26 +2263,8 @@ class C {
dynamic g(int x) => x;
}
class D extends C {
- T m<T>(T x) => x;
- T g<T>(T x) => x;
-}
-main() {
- int y = /*info:DYNAMIC_CAST*/(/*info:UNNECESSARY_CAST*/new D() as C).m(42);
- print(y);
-}
- ''');
- }
-
- void test_genericMethods_handleOverrideOfNonGenericWithGeneric_comment() {
- // Regression test for crash when adding genericity
- checkFile('''
-class C {
- m(x) => x;
- dynamic g(int x) => x;
-}
-class D extends C {
- /*=T*/ m/*<T>*/(/*=T*/ x) => x;
- /*=T*/ g/*<T>*/(/*=T*/ x) => x;
+ /*error:INVALID_METHOD_OVERRIDE*/T m<T>(T x) => x;
+ /*error:INVALID_METHOD_OVERRIDE*/T g<T>(T x) => x;
}
main() {
int y = /*info:DYNAMIC_CAST*/(/*info:UNNECESSARY_CAST*/new D() as C).m(42);
« no previous file with comments | « pkg/analyzer/test/src/task/strong/checker_test.dart ('k') | pkg/dev_compiler/tool/sdk_expected_errors.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698