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

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

Issue 17580004: Report CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clean ups to don't report 2 errors for one problem Created 7 years, 6 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/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 49374c166630a39d6106c59391ddd7a359c89d3d..444fb9e5a03f8e71173629e7ff03256f880726bb 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -482,6 +482,58 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_conflictingGetterAndMethod_field_method() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " int m;",
+ "}",
+ "class B extends A {",
+ " m() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD);
+ verify(source);
+ }
+
+ public void test_conflictingGetterAndMethod_getter_method() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " get m => 0;",
+ "}",
+ "class B extends A {",
+ " m() {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD);
+ verify(source);
+ }
+
+ public void test_conflictingGetterAndMethod_method_field() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m() {}",
+ "}",
+ "class B extends A {",
+ " int m;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER);
+ verify(source);
+ }
+
+ public void test_conflictingGetterAndMethod_method_getter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " m() {}",
+ "}",
+ "class B extends A {",
+ " get m => 0;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER);
+ verify(source);
+ }
+
public void test_constConstructorWithNonFinalField_mixin() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -1547,19 +1599,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_instanceStaticMember_instanceMethod_staticField() throws Exception {
- Source source = addSource(createSource(//
- "class A {",
- " x() {}",
- "}",
- "class B extends A {",
- " static int x;",
- "}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.INSTANCE_STATIC_MEMBER);
- verify(source);
- }
-
public void test_instanceStaticMember_instanceMethod_staticMethod() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -1573,19 +1612,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_instanceStaticMember_instanceMethodAbstract_staticField() throws Exception {
- Source source = addSource(createSource(//
- "abstract class A {",
- " x();",
- "}",
- "abstract class B extends A {",
- " static int x;",
- "}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.INSTANCE_STATIC_MEMBER);
- verify(source);
- }
-
public void test_instanceStaticMember_instanceMethodAbstract_staticMethod() throws Exception {
Source source = addSource(createSource(//
"abstract class A {",

Powered by Google App Engine
This is Rietveld 408576698