| 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 6f47f6f883958f02e056033bf7a111326e8f28e5..5243fc792d8f94c90e3900558f25d270e9e2d1a9 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
|
| @@ -3087,7 +3087,57 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
|
| verify(source);
|
| }
|
|
|
| - // TODO(scheglov)
|
| + public void test_typeAliasCannotReferenceItself_parameterType_named() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "typedef A({A a});"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeAliasCannotReferenceItself_parameterType_positional() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "typedef A([A a]);"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeAliasCannotReferenceItself_parameterType_required() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "typedef A(A 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();"));
|
| + resolve(source);
|
| + assertErrors(CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
|
| + verify(source);
|
| + }
|
| +
|
| + public void test_typeAliasCannotReferenceItself_returnType_indirect() throws Exception {
|
| + Source source = addSource(createSource(//
|
| + "typedef B A();",
|
| + "typedef A B();"));
|
| + resolve(source);
|
| + assertErrors(
|
| + CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
|
| + CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF);
|
| + 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_typeArgumentNotMatchingBounds_const() throws Exception {
|
| Source source = addSource(createSource(//
|
| "class A {}",
|
|
|