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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2940453002: Add offsets to the `== null` calls inserted by null-aware desugaring. (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// This file declares a "shadow hierarchy" of concrete classes which extend 5 /// This file declares a "shadow hierarchy" of concrete classes which extend
6 /// the kernel class hierarchy, adding methods and fields needed by the 6 /// the kernel class hierarchy, adding methods and fields needed by the
7 /// BodyBuilder. 7 /// BodyBuilder.
8 /// 8 ///
9 /// Instances of these classes may be created using the factory methods in 9 /// Instances of these classes may be created using the factory methods in
10 /// `ast_factory.dart`. 10 /// `ast_factory.dart`.
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 if (isPostIncDec) parts.add('isPostIncDec=true'); 321 if (isPostIncDec) parts.add('isPostIncDec=true');
322 if (isPreIncDec) parts.add('isPreIncDec=true'); 322 if (isPreIncDec) parts.add('isPreIncDec=true');
323 return parts; 323 return parts;
324 } 324 }
325 325
326 DartType _inferRhs(KernelTypeInferrer inferrer, DartType writeContext) { 326 DartType _inferRhs(KernelTypeInferrer inferrer, DartType writeContext) {
327 DartType inferredType = writeContext ?? const DynamicType(); 327 DartType inferredType = writeContext ?? const DynamicType();
328 if (nullAwareCombiner != null) { 328 if (nullAwareCombiner != null) {
329 var rhsType = inferrer.inferExpression(rhs, writeContext, true); 329 var rhsType = inferrer.inferExpression(rhs, writeContext, true);
330 MethodInvocation equalsInvocation = nullAwareCombiner.condition; 330 MethodInvocation equalsInvocation = nullAwareCombiner.condition;
331 inferrer.findMethodInvocationMember(writeContext, equalsInvocation); 331 inferrer.findMethodInvocationMember(writeContext, equalsInvocation,
332 silent: true);
332 return inferrer.typeSchemaEnvironment 333 return inferrer.typeSchemaEnvironment
333 .getLeastUpperBound(inferredType, rhsType); 334 .getLeastUpperBound(inferredType, rhsType);
334 } else if (combiner != null) { 335 } else if (combiner != null) {
335 bool isOverloadedArithmeticOperator = false; 336 bool isOverloadedArithmeticOperator = false;
336 var combinerMember = inferrer 337 var combinerMember = inferrer
337 .findMethodInvocationMember(writeContext, combiner, silent: true); 338 .findMethodInvocationMember(writeContext, combiner, silent: true);
338 if (combinerMember is Procedure) { 339 if (combinerMember is Procedure) {
339 isOverloadedArithmeticOperator = inferrer.typeSchemaEnvironment 340 isOverloadedArithmeticOperator = inferrer.typeSchemaEnvironment
340 .isOverloadedArithmeticOperator(combinerMember); 341 .isOverloadedArithmeticOperator(combinerMember);
341 } 342 }
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 } 2194 }
2194 2195
2195 transformChildren(v) { 2196 transformChildren(v) {
2196 return internalError("Internal error: Unsupported operation."); 2197 return internalError("Internal error: Unsupported operation.");
2197 } 2198 }
2198 2199
2199 visitChildren(v) { 2200 visitChildren(v) {
2200 return internalError("Internal error: Unsupported operation."); 2201 return internalError("Internal error: Unsupported operation.");
2201 } 2202 }
2202 } 2203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698