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

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

Issue 2997513002: Use "bool" as the downward inference context for assert conditions. (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
(...skipping 5178 matching lines...) Expand 10 before | Expand all | Expand 10 after
5189 Object visitAsExpression(AsExpression node) { 5189 Object visitAsExpression(AsExpression node) {
5190 super.visitAsExpression(node); 5190 super.visitAsExpression(node);
5191 // Since an as-statement doesn't actually change the type, we don't 5191 // Since an as-statement doesn't actually change the type, we don't
5192 // let it affect the propagated type when it would result in a loss 5192 // let it affect the propagated type when it would result in a loss
5193 // of precision. 5193 // of precision.
5194 overrideExpression(node.expression, node.type.type, false, false); 5194 overrideExpression(node.expression, node.type.type, false, false);
5195 return null; 5195 return null;
5196 } 5196 }
5197 5197
5198 @override 5198 @override
5199 Object visitAssertInitializer(AssertInitializer node) {
5200 InferenceContext.setType(node.condition, typeProvider.boolType);
5201 super.visitAssertInitializer(node);
5202 return null;
5203 }
5204
5205 @override
5199 Object visitAssertStatement(AssertStatement node) { 5206 Object visitAssertStatement(AssertStatement node) {
5207 InferenceContext.setType(node.condition, typeProvider.boolType);
5200 super.visitAssertStatement(node); 5208 super.visitAssertStatement(node);
5201 _propagateTrueState(node.condition); 5209 _propagateTrueState(node.condition);
5202 return null; 5210 return null;
5203 } 5211 }
5204 5212
5205 @override 5213 @override
5206 Object visitAssignmentExpression(AssignmentExpression node) { 5214 Object visitAssignmentExpression(AssignmentExpression node) {
5207 node.leftHandSide?.accept(this); 5215 node.leftHandSide?.accept(this);
5208 TokenType operator = node.operator.type; 5216 TokenType operator = node.operator.type;
5209 if (operator == TokenType.EQ || 5217 if (operator == TokenType.EQ ||
(...skipping 5450 matching lines...) Expand 10 before | Expand all | Expand 10 after
10660 return null; 10668 return null;
10661 } 10669 }
10662 if (identical(node.staticElement, variable)) { 10670 if (identical(node.staticElement, variable)) {
10663 if (node.inSetterContext()) { 10671 if (node.inSetterContext()) {
10664 result = true; 10672 result = true;
10665 } 10673 }
10666 } 10674 }
10667 return null; 10675 return null;
10668 } 10676 }
10669 } 10677 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698