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

Side by Side Diff: pkg/analyzer/lib/src/generated/error_verifier.dart

Issue 1052243002: Implement the new '??=' operator in analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library engine.resolver.error_verifier; 5 library engine.resolver.error_verifier;
6 6
7 import "dart:math" as math; 7 import "dart:math" as math;
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/static_type_analyzer.dart'; 10 import 'package:analyzer/src/generated/static_type_analyzer.dart';
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 Object visitAssertStatement(AssertStatement node) { 302 Object visitAssertStatement(AssertStatement node) {
303 _checkForNonBoolExpression(node); 303 _checkForNonBoolExpression(node);
304 return super.visitAssertStatement(node); 304 return super.visitAssertStatement(node);
305 } 305 }
306 306
307 @override 307 @override
308 Object visitAssignmentExpression(AssignmentExpression node) { 308 Object visitAssignmentExpression(AssignmentExpression node) {
309 sc.TokenType operatorType = node.operator.type; 309 sc.TokenType operatorType = node.operator.type;
310 Expression lhs = node.leftHandSide; 310 Expression lhs = node.leftHandSide;
311 Expression rhs = node.rightHandSide; 311 Expression rhs = node.rightHandSide;
312 if (operatorType == sc.TokenType.EQ) { 312 if (operatorType == sc.TokenType.EQ ||
313 operatorType == sc.TokenType.QUESTION_QUESTION_EQ) {
313 _checkForInvalidAssignment(lhs, rhs); 314 _checkForInvalidAssignment(lhs, rhs);
314 } else { 315 } else {
315 _checkForInvalidCompoundAssignment(node, lhs, rhs); 316 _checkForInvalidCompoundAssignment(node, lhs, rhs);
316 _checkForArgumentTypeNotAssignableForArgument(rhs); 317 _checkForArgumentTypeNotAssignableForArgument(rhs);
317 } 318 }
318 _checkForAssignmentToFinal(lhs); 319 _checkForAssignmentToFinal(lhs);
319 return super.visitAssignmentExpression(node); 320 return super.visitAssignmentExpression(node);
320 } 321 }
321 322
322 @override 323 @override
(...skipping 5651 matching lines...) Expand 10 before | Expand all | Expand 10 after
5974 toCheck.add(type.element); 5975 toCheck.add(type.element);
5975 // type arguments 5976 // type arguments
5976 if (type is InterfaceType) { 5977 if (type is InterfaceType) {
5977 InterfaceType interfaceType = type; 5978 InterfaceType interfaceType = type;
5978 for (DartType typeArgument in interfaceType.typeArguments) { 5979 for (DartType typeArgument in interfaceType.typeArguments) {
5979 _addTypeToCheck(typeArgument); 5980 _addTypeToCheck(typeArgument);
5980 } 5981 }
5981 } 5982 }
5982 } 5983 }
5983 } 5984 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/element_resolver.dart ('k') | pkg/analyzer/lib/src/generated/static_type_analyzer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698