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

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: Tweak for test. 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
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Elements.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bff4a1b251f43fa1ba07c213da2f2a1f1245fde7 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,21 @@ 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 {
+ resolveAndTest(Joiner.on("\n").join(
+ "class Object {}",
+ "class MyClass implements UnknownA {",
+ " UnknownB field;",
+ "}"),
+ DartCompilerErrorCode.NO_SUCH_TYPE,
+ DartCompilerErrorCode.NOT_A_CLASS_OR_INTERFACE,
+ DartCompilerErrorCode.NO_SUCH_TYPE);
+ }
}
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Elements.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698