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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 {bool isConst: false}) | 547 {bool isConst: false}) |
548 : super(target, arguments, isConst: isConst); | 548 : super(target, arguments, isConst: isConst); |
549 | 549 |
550 KernelStaticInvocation.byReference( | 550 KernelStaticInvocation.byReference( |
551 Reference targetReference, Arguments arguments) | 551 Reference targetReference, Arguments arguments) |
552 : super.byReference(targetReference, arguments); | 552 : super.byReference(targetReference, arguments); |
553 | 553 |
554 @override | 554 @override |
555 DartType _inferExpression( | 555 DartType _inferExpression( |
556 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 556 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
557 // TODO(scheglov): implement. | 557 return inferrer.inferStaticInvocation( |
558 return typeNeeded ? const DynamicType() : null; | 558 typeContext, |
| 559 typeNeeded, |
| 560 fileOffset, |
| 561 target, |
| 562 name, |
| 563 _getExplicitTypeArguments(arguments), |
| 564 _forEachArgument(arguments), (types) { |
| 565 arguments.types.clear(); |
| 566 arguments.types.addAll(types); |
| 567 }); |
559 } | 568 } |
560 } | 569 } |
561 | 570 |
562 /// Shadow object for [StaticSet]. | 571 /// Shadow object for [StaticSet]. |
563 class KernelStaticSet extends StaticSet implements KernelExpression { | 572 class KernelStaticSet extends StaticSet implements KernelExpression { |
564 KernelStaticSet(Member target, Expression value) : super(target, value); | 573 KernelStaticSet(Member target, Expression value) : super(target, value); |
565 | 574 |
566 KernelStaticSet.byReference(Reference targetReference, Expression value) | 575 KernelStaticSet.byReference(Reference targetReference, Expression value) |
567 : super.byReference(targetReference, value); | 576 : super.byReference(targetReference, value); |
568 | 577 |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 : super(variable, value); | 999 : super(variable, value); |
991 | 1000 |
992 @override | 1001 @override |
993 DartType _inferExpression( | 1002 DartType _inferExpression( |
994 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 1003 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
995 var variable = this.variable as KernelVariableDeclaration; | 1004 var variable = this.variable as KernelVariableDeclaration; |
996 return inferrer.inferVariableSet( | 1005 return inferrer.inferVariableSet( |
997 typeContext, typeNeeded, variable._declaredType, value); | 1006 typeContext, typeNeeded, variable._declaredType, value); |
998 } | 1007 } |
999 } | 1008 } |
OLD | NEW |