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

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

Issue 2988673003: fix override checking of mixins (Closed)
Patch Set: update status Created 3 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 | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | pkg/dev_compiler/test/compile_error_tests.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 3f9acb1e0fcbd0b778c30c75eea3d1dc717536f4..ff40070a001e89095321283bdebcc49f80d672de 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2661,6 +2661,22 @@ class F extends D with M<int> {
''');
}
+ test_interfacesFromMixinsOnlyConsiderMostDerivedMember() {
+ // Regression test for dart2js interface pattern in strong mode.
+ return checkFile(r'''
+abstract class I1 { num get x; }
+abstract class I2 extends I1 { int get x; }
+
+class M1 { num get x => 0; }
+class M2 { int get x => 0; }
+
+class Base extends Object with M1 implements I1 {}
+class Child extends Base with M2 implements I2 {}
+
+class C extends Object with M1, M2 implements I1, I2 {}
+ ''');
+ }
+
test_invalidOverrides_baseClassOverrideToChildInterface() async {
await checkFile('''
class A {}
@@ -3287,20 +3303,16 @@ class M {
m(B a) {}
}
-// Here we want to report both, because the error location is
-// different.
-// TODO(sigmund): should we merge these as well?
+// TODO(jmesserly): the `INCONSISTENT_METHOD_INHERITANCE` message is from the
+// Dart 1 checking logic (using strong mode type system), it is not produced
+// by the strong mode OverrideChecker.
class /*error:INCONSISTENT_METHOD_INHERITANCE*/T1
- /*error:INVALID_METHOD_OVERRIDE_FROM_BASE*/extends Base
+ extends Base
with /*error:INVALID_METHOD_OVERRIDE_FROM_MIXIN*/M
implements I1 {}
-
-// Here we want to report both, because the error location is
-// different.
-// TODO(sigmund): should we merge these as well?
class /*error:INCONSISTENT_METHOD_INHERITANCE*/U1 =
- /*error:INVALID_METHOD_OVERRIDE_FROM_BASE*/Base
+ Base
with /*error:INVALID_METHOD_OVERRIDE_FROM_MIXIN*/M
implements I1;
''');
@@ -3351,11 +3363,8 @@ class M2 {
m(B a) {}
}
-// Here we want to report both, because the error location is
-// different.
-// TODO(sigmund): should we merge these as well?
class /*error:INCONSISTENT_METHOD_INHERITANCE*/T1 extends Object
- with /*error:INVALID_METHOD_OVERRIDE_FROM_MIXIN*/M1,
+ with M1,
/*error:INVALID_METHOD_OVERRIDE_FROM_MIXIN*/M2
implements I1 {}
''');
« no previous file with comments | « pkg/analyzer/lib/src/task/strong/checker.dart ('k') | pkg/dev_compiler/test/compile_error_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698