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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java

Issue 8467017: Fix for cyclic declaration, issue 348 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698