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

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

Issue 10918247: Issue 5084. Report error if a type name appears multiple times in an implements clause (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't report duplicates for unresolved types Created 8 years, 3 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/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 3367c766703f60449a36bc4b2db95ce423fece5a..b0e8bf0a95b12dcb6bdafaa72814ca4539c4432a 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -4772,6 +4772,48 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
}
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=5084
+ */
+ public void test_duplicateSuperInterface_errorInClassImplements() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class A {}",
+ "class B implements A, A {}",
+ "");
+ assertErrors(result.getErrors(), errEx(ResolverErrorCode.DUPLICATE_IMPLEMENTS_TYPE, 3, 23, 1));
+ }
+
+ /**
+ * We should report only "no such type", but not duplicate.
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=5084
+ */
+ public void test_duplicateSuperInterface_whenNoSuchType() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "class B implements X, Y {}",
+ "");
+ assertErrors(
+ result.getErrors(),
+ errEx(ResolverErrorCode.NO_SUCH_TYPE, 2, 20, 1),
+ errEx(ResolverErrorCode.NO_SUCH_TYPE, 2, 23, 1));
+ }
+
+ /**
+ * <p>
+ * http://code.google.com/p/dart/issues/detail?id=5084
+ */
+ public void test_duplicateSuperInterface_okInInterfaceExtends() throws Exception {
+ AnalyzeLibraryResult result = analyzeLibrary(
+ "// filler filler filler filler filler filler filler filler filler filler",
+ "interface A {}",
+ "interface B extends A, A {}",
+ "");
+ assertErrors(result.getErrors());
+ }
+
private <T extends DartNode> T findNode(final Class<T> clazz, String pattern) {
final int index = testSource.indexOf(pattern);
assertTrue(index != -1);
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/SupertypeResolver.java ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698