Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
index 11022f6ffd30a2e9af07c3de738a11c026b43b56..b312dec49532840c136d4cda35ee8345ad175399 100644 |
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
@@ -1375,6 +1375,25 @@ public class TypeAnalyzerTest extends TypeTestCase { |
analyzeFail("(new Class().m)().x;", TypeErrorCode.VOID); |
} |
+ /** |
+ * There was problem that cyclic class declaration caused infinite loop. |
+ * <p> |
+ * http://code.google.com/p/dart/issues/detail?id=348 |
+ */ |
+ public void test_cyclicDeclaration() { |
+ Map<String, ClassElement> source = loadSource( |
+ "class Foo extends Bar {", |
+ "}", |
+ "class Bar extends Foo {", |
+ "}"); |
+ analyzeClasses(source); |
+ // Foo and Bar have cyclic declaration |
+ ClassElement classFoo = source.get("Foo"); |
+ ClassElement classBar = source.get("Bar"); |
+ assertEquals(classFoo, classBar.getSupertype().getElement()); |
+ assertEquals(classBar, classFoo.getSupertype().getElement()); |
+ } |
+ |
private Map<String, ClassElement> analyzeClasses(Map<String, ClassElement> classes, |
ErrorCode... codes) { |
setExpectedTypeErrorCount(codes.length); |