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

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

Issue 62523002: Fix for 11987. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 465a9e1b78d1a33e04020b3e04c1112a4dd6a332..7bd91fca515ae6b904f02ea15f146a8635a12c79 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
@@ -15,6 +15,7 @@ package com.google.dart.engine.resolver;
import com.google.dart.engine.error.CompileTimeErrorCode;
import com.google.dart.engine.error.HintCode;
+import com.google.dart.engine.error.StaticTypeWarningCode;
import com.google.dart.engine.error.StaticWarningCode;
import com.google.dart.engine.parser.ParserErrorCode;
import com.google.dart.engine.source.Source;
@@ -3324,6 +3325,22 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_typeAliasCannotReferenceItself_11987() throws Exception {
+ Source source = addSource(createSource(//
+ "typedef void F(List<G> l);",
+ "typedef void G(List<F> l);",
+ "main() {",
+ " F foo(G g) => g;",
+ "}"));
+ resolve(source);
+ assertErrors(
+ source,
+ CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+ CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
+ StaticTypeWarningCode.RETURN_OF_INVALID_TYPE);
+ verify(source);
+ }
+
public void test_typeAliasCannotReferenceItself_parameterType_named() throws Exception {
Source source = addSource(createSource(//
"typedef A({A a});"));

Powered by Google App Engine
This is Rietveld 408576698