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

Unified Diff: compiler/javatests/com/google/dart/compiler/resolver/ResolverTest.java

Issue 8382003: Can not find Element in Dynamic element. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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: 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;",
+ "}"));
+ }
}

Powered by Google App Engine
This is Rietveld 408576698