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

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

Issue 10548002: Fix for issue 2351 - checking assignability on top level getters and setters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Attempting to reapply patch with setElement() calls. Created 8 years, 6 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/ResolverCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java b/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
index c2082fad8930f27c3586dcf17ed028c387ac7c69..9c003ec1bda37ee98a49a245a0417a8fb1b8b750 100644
--- a/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/resolver/ResolverCompilerTest.java
@@ -3,9 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.resolver;
-import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
-import static com.google.dart.compiler.common.ErrorExpectation.errEx;
-
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.io.CharStreams;
@@ -17,6 +14,7 @@ import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartDeclaration;
import com.google.dart.compiler.ast.DartExprStmt;
import com.google.dart.compiler.ast.DartExpression;
+import com.google.dart.compiler.ast.DartField;
import com.google.dart.compiler.ast.DartFieldDefinition;
import com.google.dart.compiler.ast.DartFunctionExpression;
import com.google.dart.compiler.ast.DartFunctionTypeAlias;
@@ -36,6 +34,9 @@ import com.google.dart.compiler.type.FunctionAliasType;
import com.google.dart.compiler.type.Type;
import com.google.dart.compiler.type.TypeVariable;
+import static com.google.dart.compiler.common.ErrorExpectation.assertErrors;
+import static com.google.dart.compiler.common.ErrorExpectation.errEx;
+
import java.io.Reader;
import java.util.LinkedList;
import java.util.List;
@@ -811,7 +812,13 @@ public class ResolverCompilerTest extends CompilerTestCase {
}
{
DartFieldDefinition fieldDef = (DartFieldDefinition) classA.getMembers().get(1);
- assertDeclarationNameElement(fieldDef.getFields().get(0), "a2");
+ // since this is a getter, its actually a method element different from the original.
+ DartField f = fieldDef.getFields().get(0);
+ assertNotNull(f);
+ Element e = f.getElement();
+ assertNotNull(e);
+ assertTrue(f.getName().getName().equals("a2"));
+ assertTrue(e.getName().equals("a2"));
}
{
DartMethodDefinition constructor = (DartMethodDefinition) classA.getMembers().get(2);

Powered by Google App Engine
This is Rietveld 408576698