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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/BinaryExpression.java

Issue 15736017: Issue 1015. Report problem for incompatible right operand and index types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/BinaryExpression.java
diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/BinaryExpression.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/BinaryExpression.java
index 05036187326aca3e3005c6d0c9effd96d1b83c67..e874d5c11a2a7ff4472ff3c5f26b9aea5f03d300 100644
--- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/BinaryExpression.java
+++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/BinaryExpression.java
@@ -14,6 +14,7 @@
package com.google.dart.engine.ast;
import com.google.dart.engine.element.MethodElement;
+import com.google.dart.engine.element.ParameterElement;
import com.google.dart.engine.scanner.Token;
/**
@@ -156,4 +157,24 @@ public class BinaryExpression extends Expression {
safelyVisitChild(leftOperand, visitor);
safelyVisitChild(rightOperand, visitor);
}
+
+ /**
+ * Return the parameter element representing the parameter to which the value of the right operand
+ * will be bound. May be {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getParameterElement()}.
+ *
+ * @return the parameter element representing the parameter to which the value of the right
+ * operand will be bound
+ */
+ protected ParameterElement getParameterElementForRightOperand() {
+ if (element == null) {
+ return null;
+ }
+ ParameterElement[] parameters = element.getParameters();
+ if (parameters.length < 1) {
+ return null;
+ }
+ return parameters[0];
+ }
}

Powered by Google App Engine
This is Rietveld 408576698