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

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

Issue 15855005: Implementation of CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE error code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase with bleeding_edge Created 7 years, 7 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 a9bc09cc96a2a7362f9a7977624caa71b6177029..a70d1783385785022ebe4495bacc17769eec8890 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
@@ -209,23 +209,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void fail_recursiveInterfaceInheritance_direct() throws Exception {
- Source source = addSource(createSource(//
- "class A implements A {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
- verify(source);
- }
-
- public void fail_recursiveInterfaceInheritance_indirect() throws Exception {
- Source source = addSource(createSource(//
- "class A implements B {}",
- "class B implements A {}"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
- verify(source);
- }
-
public void fail_redirectToNonConstConstructor() throws Exception {
Source source = addSource(createSource(//
// TODO
@@ -2435,7 +2418,10 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
assertErrors(
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
- CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT);
+ CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
verify(source);
}
@@ -2464,7 +2450,10 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
assertErrors(
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
- CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT);
+ CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
verify(source);
}
@@ -2483,7 +2472,10 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
assertErrors(
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
- CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT);
+ CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
verify(source);
}
@@ -2505,7 +2497,46 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
resolve(source);
assertErrors(
CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
- CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT);
+ CompileTimeErrorCode.RECURSIVE_FACTORY_REDIRECT,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritance() throws Exception {
+ Source source = addSource(createSource(//
+ "class A implements B {}",
+ "class B implements A {}"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritance_tail() throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A implements B {}",
+ "abstract class B implements A {}",
+ "class C implements A {}"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
+ verify(source);
+ }
+
+ public void test_recursiveInterfaceInheritance_tail2() throws Exception {
+ Source source = addSource(createSource(//
+ "abstract class A implements B {}",
+ "abstract class B implements C {}",
+ "abstract class C implements A {}",
+ "class D implements A {}"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
+ CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE);
verify(source);
}

Powered by Google App Engine
This is Rietveld 408576698