Index: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java |
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java |
index 28953a5822333b3a1eae72ffc2ee91bd3cfb343e..b35ef8986fb8ac8fed4c93f158be1af9ecc0abb9 100644 |
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java |
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java |
@@ -11,6 +11,7 @@ import com.google.dart.compiler.ErrorCode; |
import com.google.dart.compiler.ast.DartClass; |
import com.google.dart.compiler.testing.TestCompilerContext; |
import com.google.dart.compiler.testing.TestCompilerContext.EventKind; |
+import com.google.dart.compiler.type.DynamicType; |
import com.google.dart.compiler.type.InterfaceType; |
import com.google.dart.compiler.type.Type; |
import com.google.dart.compiler.type.Types; |
@@ -535,4 +536,18 @@ public class ResolverTest extends ResolverTestCase { |
"}"), |
DartCompilerErrorCode.NO_SUCH_TYPE); |
} |
+ |
+ /** |
+ * When {@link SupertypeResolver} can not find "UnknownA", it uses {@link DynamicType}, which |
+ * returns {@link DynamicElement}. By itself, this is OK. However when we later try to resolve |
+ * second unknown type "UnknownB", we expect in {@link Elements#findElement()} specific |
+ * {@link ClassElement} implementation and {@link DynamicElement} is not valid. |
+ */ |
+ public void test_classDynamicElement_fieldDynamicElement() throws Exception { |
+ resolve(makeCode( |
zundel
2011/10/24 15:07:44
Won't resolveAndTest in conjuction with Joiner.on(
scheglov
2011/10/24 19:57:55
Done.
|
+ "class Object {}", |
+ "class MyClass implements UnknownA {", |
+ " UnknownB field;", |
+ "}")); |
+ } |
} |