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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 18293017: Report MIXIN_TYPEDEF_CYCLE. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Report TYPE_ALIAS_CANNOT_REFERENCE_ITSELF instead Created 7 years, 5 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index afbb123a434f08ddead09e501780a8a9a003e6eb..ea653ec9bc8c8a7e234bacd838d2245c04efc450 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -3233,6 +3233,25 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_typeAliasCannotRereferenceItself_mixin_direct() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef M = Object with M;"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
+ verify(source);
+ }
+
+ public void test_typeAliasCannotRereferenceItself_mixin_indirect() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef M1 = Object with M2;",
+ "typedef M2 = Object with M1;"));
+ resolve(source);
+ assertErrors(
+ CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+ CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
+ verify(source);
+ }
+
public void test_typeArgumentNotMatchingBounds_const() throws Exception {
Source source = addSource(createSource(//
"class A {}",

Powered by Google App Engine
This is Rietveld 408576698