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

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

Issue 23382007: Fix for 12494 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/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 52d6c3f8573befa4385e0ceb619d622e9ac04bd5..bea25e4363df633b44f5d11990e218ccb9816afd 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
@@ -896,6 +896,33 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_duplicateDefinitionInheritance_instanceGetter_staticGetter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " int get x => 0;",
+ "}",
+ "class B extends A {",
+ " static int get x => 0;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_duplicateDefinitionInheritance_instanceGetterAbstract_staticGetter()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " int get x;",
+ "}",
+ "class B extends A {",
+ " static int get x => 0;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE);
+ verify(source);
+ }
+
public void test_duplicateDefinitionInheritance_instanceMethod_staticMethod() throws Exception {
Source source = addSource(createSource(//
"class A {",
@@ -923,6 +950,33 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_duplicateDefinitionInheritance_instanceSetter_staticSetter() throws Exception {
+ Source source = addSource(createSource(//
+ "class A {",
+ " set x(value) {}",
+ "}",
+ "class B extends A {",
+ " static set x(value) {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_duplicateDefinitionInheritance_instanceSetterAbstract_staticSetter()
+ throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A {",
+ " set x(value);",
+ "}",
+ "class B extends A {",
+ " static set x(value) {}",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE);
+ verify(source);
+ }
+
public void test_duplicateNamedArgument() throws Exception {
Source source = addSource(createSource(//
"f({a, b}) {}",

Powered by Google App Engine
This is Rietveld 408576698