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

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

Issue 22159004: Issue 11987. Make typedef self-reference more restrictive. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 53539c23e87229b848d56736de04573748b74f18..85d91522632192780151c3d63be169bae55e29c1 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
@@ -3053,6 +3053,26 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_typeAliasCannotReferenceItself_parameterType_typeArgument() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef A(List<A> a);"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
+ verify(source);
+ }
+
+ public void test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef C A();",
+ "typedef A B();",
+ "class C {",
+ " B a;",
+ "}"));
+ resolve(source);
+ assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
+ verify(source);
+ }
+
public void test_typeAliasCannotReferenceItself_returnType() throws Exception {
Source source = addSource(createSource(//
"typedef A A();"));
@@ -3072,14 +3092,6 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
- public void test_typeAliasCannotReferenceItself_typeVariableBounds() throws Exception {
- Source source = addSource(createSource(//
- "typedef A<T extends A>();"));
- resolve(source);
- assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
- verify(source);
- }
-
public void test_typeAliasCannotRereferenceItself_mixin_direct() throws Exception {
Source source = addSource(createSource(//
"typedef M = Object with M;"));

Powered by Google App Engine
This is Rietveld 408576698