OLD | NEW |
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } | 493 } |
494 | 494 |
495 /// Concrete shadow object representing a string concatenation in kernel form. | 495 /// Concrete shadow object representing a string concatenation in kernel form. |
496 class KernelStringConcatenation extends StringConcatenation | 496 class KernelStringConcatenation extends StringConcatenation |
497 implements KernelExpression { | 497 implements KernelExpression { |
498 KernelStringConcatenation(List<Expression> expressions) : super(expressions); | 498 KernelStringConcatenation(List<Expression> expressions) : super(expressions); |
499 | 499 |
500 @override | 500 @override |
501 DartType _inferExpression( | 501 DartType _inferExpression( |
502 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 502 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
503 // TODO(scheglov) Add and use inferStringConcatenation() instead. | 503 return inferrer.inferStringConcatenation( |
504 return inferrer.inferStringLiteral(typeContext, typeNeeded); | 504 typeContext, typeNeeded, expressions); |
505 } | 505 } |
506 } | 506 } |
507 | 507 |
508 /// Concrete shadow object representing a string literal in kernel form. | 508 /// Concrete shadow object representing a string literal in kernel form. |
509 class KernelStringLiteral extends StringLiteral implements KernelExpression { | 509 class KernelStringLiteral extends StringLiteral implements KernelExpression { |
510 KernelStringLiteral(String value) : super(value); | 510 KernelStringLiteral(String value) : super(value); |
511 | 511 |
512 @override | 512 @override |
513 DartType _inferExpression( | 513 DartType _inferExpression( |
514 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 514 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 // KernelVariableDeclaration. | 878 // KernelVariableDeclaration. |
879 mutatedInClosure = true; | 879 mutatedInClosure = true; |
880 declaredType = variable.type; | 880 declaredType = variable.type; |
881 } | 881 } |
882 return inferrer.inferVariableGet(typeContext, typeNeeded, mutatedInClosure, | 882 return inferrer.inferVariableGet(typeContext, typeNeeded, mutatedInClosure, |
883 _fact, _scope, fileOffset, declaredType, (type) { | 883 _fact, _scope, fileOffset, declaredType, (type) { |
884 promotedType = type; | 884 promotedType = type; |
885 }); | 885 }); |
886 } | 886 } |
887 } | 887 } |
OLD | NEW |