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

Unified Diff: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java

Issue 10827127: Issue 4315. Fix for type of cascade assignment (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
index 89dd0723855eaefe80e2f74fcac6fa7ca380b9f9..1c11c7ea8425c67921bcd53386f6551b6299b1da 100644
--- a/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/type/TypeAnalyzer.java
@@ -361,6 +361,14 @@ public class TypeAnalyzer implements DartCompilationPhase {
checkAssignable(rhsNode, lhs, rhs);
}
checkAssignableElement(lhsNode);
+ // if cascade, then use type of "lhs" qualifier
+ if (lhsNode instanceof DartPropertyAccess) {
+ DartPropertyAccess lhsAccess = (DartPropertyAccess) lhsNode;
+ if (lhsAccess.isCascade()) {
+ return lhsAccess.getQualifier().getType();
+ }
+ }
+ // use type or "rhs"
return rhs;
}
@@ -1976,9 +1984,6 @@ public class TypeAnalyzer implements DartCompilationPhase {
@Override
public Type visitPropertyAccess(DartPropertyAccess node) {
- if (node.isCascade()) {
- return node.getQualifier().accept(this);
- }
if (node.getType() != null) {
return node.getType();
}
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698