| Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
|
| index 5b26cab03bcb458f0332be832d2d66a7b37af600..46e5953b134296a849f293782b1a23addb81db61 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
|
| @@ -62,6 +62,7 @@ import com.google.dart.compiler.ast.DartTryStatement;
|
| import com.google.dart.compiler.ast.DartTypeExpression;
|
| 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.DartUnit;
|
| import com.google.dart.compiler.ast.DartUnqualifiedInvocation;
|
| import com.google.dart.compiler.ast.DartVariable;
|
| @@ -1877,6 +1878,25 @@ public class Resolver {
|
| }
|
|
|
| @Override
|
| + public Element visitUnaryExpression(DartUnaryExpression node) {
|
| + DartExpression arg = node.getArg();
|
| + Element argElement = resolve(arg);
|
| + if (node.getOperator().isCountOperator()) {
|
| + switch (ElementKind.of(argElement)) {
|
| + case FIELD:
|
| + case PARAMETER:
|
| + case VARIABLE:
|
| + if (argElement.getModifiers().isFinal()) {
|
| + topLevelContext.onError(arg, ResolverErrorCode.CANNOT_ASSIGN_TO_FINAL,
|
| + argElement.getName());
|
| + }
|
| + break;
|
| + }
|
| + }
|
| + return null;
|
| + }
|
| +
|
| + @Override
|
| public Element visitMapLiteral(DartMapLiteral node) {
|
| List<DartTypeNode> originalTypeArgs = node.getTypeArguments();
|
| List<DartTypeNode> typeArgs = Lists.newArrayList();
|
|
|