| Index: compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/Elements.java b/compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| index a1489db4597bff2b6ff584eeb425fbe3e660b09b..be74a38fde9e893394bcd8feea939d97d4e370d8 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/Elements.java
|
| @@ -28,6 +28,7 @@ import com.google.dart.compiler.ast.DartParameter;
|
| import com.google.dart.compiler.ast.DartSuperExpression;
|
| import com.google.dart.compiler.ast.DartTypeNode;
|
| import com.google.dart.compiler.ast.DartTypeParameter;
|
| +import com.google.dart.compiler.ast.DartUnaryExpression;
|
| import com.google.dart.compiler.ast.DartVariable;
|
| import com.google.dart.compiler.ast.LibraryUnit;
|
| import com.google.dart.compiler.ast.Modifiers;
|
| @@ -779,6 +780,12 @@ static FieldElementImplementation fieldFromNode(DartField node,
|
| * expression. Other types of assignments also read the value and require a getter access.
|
| */
|
| public static boolean inSetterContext(DartNode node) {
|
| + if (node.getParent() instanceof DartUnaryExpression) {
|
| + DartUnaryExpression expr = (DartUnaryExpression) node.getParent();
|
| + if (expr.getArg() == node && expr.getOperator().isCountOperator()) {
|
| + return true;
|
| + }
|
| + }
|
| if (node.getParent() instanceof DartBinaryExpression) {
|
| DartBinaryExpression expr = (DartBinaryExpression) node.getParent();
|
| if (ASSIGN_OPERATORS.contains(expr.getOperator()) && expr.getArg1() == node) {
|
|
|