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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 10389204: Fix for double getter int for-each (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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/type/TypeAnalyzer.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/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 27c912662af082602da749cb34cde975224f9bd8..5eb0f81a2a5a283bb6e3339de25d090a58475ed9 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -21,6 +21,7 @@ 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.DartForInStatement;
import com.google.dart.compiler.ast.DartFunctionExpression;
import com.google.dart.compiler.ast.DartIdentifier;
import com.google.dart.compiler.ast.DartInvocation;
@@ -509,6 +510,27 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
}
/**
+ * There was problem that {@link DartForInStatement} visits "iterable" two times. At first time we
+ * set {@link MethodElement}, because we resolve it to getter. However because of this at second
+ * time we can not resolve. Solution - don't try to resolve second time, we already done at first
+ * time. Note: double getter is important.
+ */
+ public void test_doubleGetterAccess_inForEach() throws Exception {
+ AnalyzeLibraryResult libraryResult = analyzeLibrary(
+ getName(),
+ makeCode(
+ "class Test {",
+ " Iterable get iter() {}",
+ "}",
+ "Test get test() {}",
+ "f() {",
+ " for (var v in test.iter) {}",
+ "}",
+ ""));
+ assertErrors(libraryResult.getTypeErrors());
+ }
+
+ /**
* Test for errors and warnings related to positional and named arguments for required and
* optional parameters.
*/
« no previous file with comments | « compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698