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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java

Issue 22339023: Fix for issue 11497- liberalize warnings about bad overrides (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files Created 7 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
Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
index 585438b3282d059ef2093a024ff687ad23c24c48..ec4a774b16269d131f13ec44ab01b8d4de890ec7 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/StaticWarningCodeTest.java
@@ -1325,6 +1325,58 @@ public class StaticWarningCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_invalidOverrideNamed_fewerNamedParameters() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m({a, b}) {}",
+ "}",
+ "class B extends A {",
+ " m({a}) {}",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.INVALID_OVERRIDE_NAMED);
+ verify(source);
+ }
+
+ public void test_invalidOverrideNamed_missingNamedParameter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m({a, b}) {}",
+ "}",
+ "class B extends A {",
+ " m({a, c}) {}",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.INVALID_OVERRIDE_NAMED);
+ verify(source);
+ }
+
+ public void test_invalidOverridePositional() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m([a, b]) {}",
+ "}",
+ "class B extends A {",
+ " m([a]) {}",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.INVALID_OVERRIDE_POSITIONAL);
+ verify(source);
+ }
+
+ public void test_invalidOverrideRequired() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m(a) {}",
+ "}",
+ "class B extends A {",
+ " m(a, b) {}",
+ "}"));
+ resolve(source);
+ assertErrors(StaticWarningCode.INVALID_OVERRIDE_REQUIRED);
+ verify(source);
+ }
+
public void test_invalidSetterOverrideNormalParamType() throws Exception {
Source source = addSource(createSource(//
"class A {",

Powered by Google App Engine
This is Rietveld 408576698