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

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

Issue 9186017: Fix crash in dartc when given cyclic type variable bounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Went back to prior verion of tests. Created 8 years, 11 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: 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 2de3844c10e82e505142b7fb418b6991373cc0df..ce30bfaeab21c1ab59e819f6c7a4acea4a5f0685 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -306,6 +306,27 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
analyzeClass(classes.get("OptionalParameter"), 1);
}
+ public void testCyclicTypeVariable() {
+ Map<String, ClassElement> classes = loadSource(
+ "interface A<T> { }",
+ "typedef funcType<T>(T arg);",
+ "class B<T extends T> {}",
+ "class C<T extends A<T>> {}",
+ "class D<T extends funcType<T>> {}");
+ analyzeClasses(classes,
+ TypeErrorCode.CYCLIC_REFERENCE_TO_TYPE_VARIABLE);
+ ClassElement B = classes.get("B");
+ analyzeClass(B, 1);
+ assertEquals(1, B.getType().getArguments().size());
+ ClassElement C = classes.get("C");
+ analyzeClass(C, 0);
+ assertEquals(1, C.getType().getArguments().size());
+ ClassElement D = classes.get("D");
+ analyzeClass(D, 0);
+ assertEquals(1, D.getType().getArguments().size());
+
+ }
+
public void testDoWhileStatement() {
analyze("do {} while (true);");
analyze("do {} while (null);");

Powered by Google App Engine
This is Rietveld 408576698