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

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

Issue 9014029: Fix dartc bounds checking for invoking interface constructors/factory methods (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added missing test file, renamed to remove 'Negative' from name Created 8 years, 12 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 576dee55cee8b4252feb732db0dd85d7778ec3d4..e22de0360df5cd278bf5a744c8f1e46729eaef07 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java
@@ -1346,4 +1346,21 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase {
analyzeFail("while ('') {}",
TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
}
+
+
+ public void testValidateFactoryBounds() {
+ Map<String, ClassElement> source = loadSource(
+ "class Object {}",
+ "interface Foo {}",
+ "interface Bar extends Foo {}",
+ "interface IA<T> default A<T extends Foo> { IA(); }",
+ "class A<T extends Foo> implements IA<T> {",
+ " factory A() {}",
+ "}");
+ analyzeClasses(source);
+ // analyze("{ var val1 = new IA<Foo>(); }");
+ // analyze("{ var val1 = new IA<Bar>(); }");
+ analyzeFail("{ var val1 = new IA<String>(); }",TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE);
+
+ }
}

Powered by Google App Engine
This is Rietveld 408576698