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

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

Issue 2861523003: Add KernelXyzExpression stubs and factory methods. (Closed)
Patch Set: Created 3 years, 7 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`.
11 /// 11 ///
12 /// Note that these classes represent the Dart language prior to desugaring. 12 /// Note that these classes represent the Dart language prior to desugaring.
13 /// When a single Dart construct desugars to a tree containing multiple kernel 13 /// When a single Dart construct desugars to a tree containing multiple kernel
14 /// AST nodes, the shadow class extends the kernel object at the top of the 14 /// AST nodes, the shadow class extends the kernel object at the top of the
15 /// desugared tree. 15 /// desugared tree.
16 /// 16 ///
17 /// This means that in some cases multiple shadow classes may extend the same 17 /// This means that in some cases multiple shadow classes may extend the same
18 /// kernel class, because multiple constructs in Dart may desugar to a tree 18 /// kernel class, because multiple constructs in Dart may desugar to a tree
19 /// with the same kind of root node. 19 /// with the same kind of root node.
20 import 'package:front_end/src/base/instrumentation.dart'; 20 import 'package:front_end/src/base/instrumentation.dart';
21 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart'; 21 import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart';
22 import 'package:front_end/src/fasta/type_inference/type_inferrer.dart'; 22 import 'package:front_end/src/fasta/type_inference/type_inferrer.dart';
23 import 'package:front_end/src/fasta/type_inference/type_promotion.dart'; 23 import 'package:front_end/src/fasta/type_inference/type_promotion.dart';
24 import 'package:kernel/ast.dart'; 24 import 'package:kernel/ast.dart';
25 25
26 /// Shadow object for [AsExpression].
27 class KernelAsExpression extends AsExpression implements KernelExpression {
28 KernelAsExpression(Expression operand, DartType type) : super(operand, type);
29
30 @override
31 DartType _inferExpression(
32 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
33 // TODO(scheglov): implement.
34 return typeNeeded ? const DynamicType() : null;
35 }
36 }
37
38 /// Shadow object for [AwaitExpression].
39 class KernelAwaitExpression extends AwaitExpression
40 implements KernelExpression {
41 KernelAwaitExpression(Expression operand) : super(operand);
42
43 @override
44 DartType _inferExpression(
45 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
46 // TODO(scheglov): implement.
47 return typeNeeded ? const DynamicType() : null;
48 }
49 }
50
26 /// Concrete shadow object representing a statement block in kernel form. 51 /// Concrete shadow object representing a statement block in kernel form.
27 class KernelBlock extends Block implements KernelStatement { 52 class KernelBlock extends Block implements KernelStatement {
28 KernelBlock(List<Statement> statements) : super(statements); 53 KernelBlock(List<Statement> statements) : super(statements);
29 54
30 @override 55 @override
31 void _inferStatement(KernelTypeInferrer inferrer) { 56 void _inferStatement(KernelTypeInferrer inferrer) {
32 for (var statement in statements) { 57 for (var statement in statements) {
33 inferrer.inferStatement(statement); 58 inferrer.inferStatement(statement);
34 } 59 }
35 } 60 }
36 } 61 }
37 62
38 /// Concrete shadow object representing a boolean literal in kernel form. 63 /// Concrete shadow object representing a boolean literal in kernel form.
39 class KernelBoolLiteral extends BoolLiteral implements KernelExpression { 64 class KernelBoolLiteral extends BoolLiteral implements KernelExpression {
40 KernelBoolLiteral(bool value) : super(value); 65 KernelBoolLiteral(bool value) : super(value);
41 66
42 @override 67 @override
43 DartType _inferExpression( 68 DartType _inferExpression(
44 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 69 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
45 return inferrer.inferBoolLiteral(typeContext, typeNeeded); 70 return inferrer.inferBoolLiteral(typeContext, typeNeeded);
46 } 71 }
47 } 72 }
48 73
74 /// Shadow object for [ConditionalExpression].
75 class KernelConditionalExpression extends ConditionalExpression
76 implements KernelExpression {
77 KernelConditionalExpression(Expression condition, Expression then,
78 Expression otherwise, DartType staticType)
79 : super(condition, then, otherwise, staticType);
80
81 @override
82 DartType _inferExpression(
83 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
84 // TODO(scheglov): implement.
85 return typeNeeded ? const DynamicType() : null;
86 }
87 }
88
89 /// Shadow object for [ConstructorInvocation].
90 class KernelConstructorInvocation extends ConstructorInvocation
91 implements KernelExpression {
92 KernelConstructorInvocation(Constructor target, Arguments arguments,
93 {bool isConst: false})
94 : super(target, arguments, isConst: isConst);
95
96 KernelConstructorInvocation.byReference(
97 Reference targetReference, Arguments arguments)
98 : super.byReference(targetReference, arguments);
99
100 @override
101 DartType _inferExpression(
102 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
103 // TODO(scheglov): implement.
104 return typeNeeded ? const DynamicType() : null;
105 }
106 }
107
108 /// Shadow object for [DirectMethodInvocation].
109 class KernelDirectMethodInvocation extends DirectMethodInvocation
110 implements KernelExpression {
111 KernelDirectMethodInvocation(
112 Expression receiver, Procedure target, Arguments arguments)
113 : super(receiver, target, arguments);
114
115 KernelDirectMethodInvocation.byReference(
116 Expression receiver, Reference targetReference, Arguments arguments)
117 : super.byReference(receiver, targetReference, arguments);
118
119 @override
120 DartType _inferExpression(
121 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
122 // TODO(scheglov): implement.
123 return typeNeeded ? const DynamicType() : null;
124 }
125 }
126
127 /// Shadow object for [DirectPropertyGet].
128 class KernelDirectPropertyGet extends DirectPropertyGet
129 implements KernelExpression {
130 KernelDirectPropertyGet(Expression receiver, Member target)
131 : super(receiver, target);
132
133 KernelDirectPropertyGet.byReference(
134 Expression receiver, Reference targetReference)
135 : super.byReference(receiver, targetReference);
136
137 @override
138 DartType _inferExpression(
139 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
140 // TODO(scheglov): implement.
141 return typeNeeded ? const DynamicType() : null;
142 }
143 }
144
145 /// Shadow object for [DirectPropertySet].
146 class KernelDirectPropertySet extends DirectPropertySet
147 implements KernelExpression {
148 KernelDirectPropertySet(Expression receiver, Member target, Expression value)
149 : super(receiver, target, value);
150
151 KernelDirectPropertySet.byReference(
152 Expression receiver, Reference targetReference, Expression value)
153 : super.byReference(receiver, targetReference, value);
154
155 @override
156 DartType _inferExpression(
157 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
158 // TODO(scheglov): implement.
159 return typeNeeded ? const DynamicType() : null;
160 }
161 }
162
49 /// Concrete shadow object representing a double literal in kernel form. 163 /// Concrete shadow object representing a double literal in kernel form.
50 class KernelDoubleLiteral extends DoubleLiteral implements KernelExpression { 164 class KernelDoubleLiteral extends DoubleLiteral implements KernelExpression {
51 KernelDoubleLiteral(double value) : super(value); 165 KernelDoubleLiteral(double value) : super(value);
52 166
53 @override 167 @override
54 DartType _inferExpression( 168 DartType _inferExpression(
55 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 169 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
56 return inferrer.inferDoubleLiteral(typeContext, typeNeeded); 170 return inferrer.inferDoubleLiteral(typeContext, typeNeeded);
57 } 171 }
58 } 172 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 : super(expressions, typeArgument: typeArgument, isConst: isConst); 303 : super(expressions, typeArgument: typeArgument, isConst: isConst);
190 304
191 @override 305 @override
192 DartType _inferExpression( 306 DartType _inferExpression(
193 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 307 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
194 // TODO(paulberry): implement. 308 // TODO(paulberry): implement.
195 return typeNeeded ? const DynamicType() : null; 309 return typeNeeded ? const DynamicType() : null;
196 } 310 }
197 } 311 }
198 312
313 /// Shadow object for [LogicalExpression].
314 class KernelLogicalExpression extends LogicalExpression
315 implements KernelExpression {
316 KernelLogicalExpression(Expression left, String operator, Expression right)
317 : super(left, operator, right);
318
319 @override
320 DartType _inferExpression(
321 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
322 // TODO(scheglov): implement.
323 return typeNeeded ? const DynamicType() : null;
324 }
325 }
326
327 /// Shadow object for [MapLiteral].
328 class KernelMapLiteral extends MapLiteral implements KernelExpression {
329 KernelMapLiteral(List<MapEntry> entries,
330 {DartType keyType: const DynamicType(),
331 DartType valueType: const DynamicType(),
332 bool isConst: false})
333 : super(entries,
334 keyType: keyType, valueType: valueType, isConst: isConst);
335
336 @override
337 DartType _inferExpression(
338 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
339 // TODO(scheglov): implement.
340 return typeNeeded ? const DynamicType() : null;
341 }
342 }
343
344 /// Shadow object for [MethodInvocation].
345 class KernelMethodInvocation extends MethodInvocation
346 implements KernelExpression {
347 KernelMethodInvocation(Expression receiver, Name name, Arguments arguments)
348 : super(receiver, name, arguments);
349
350 KernelMethodInvocation.byReference(Expression receiver, Name name,
351 Arguments arguments, Reference interfaceTargetReference)
352 : super.byReference(receiver, name, arguments, interfaceTargetReference);
353
354 @override
355 DartType _inferExpression(
356 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
357 // TODO(scheglov): implement.
358 return typeNeeded ? const DynamicType() : null;
359 }
360 }
361
362 /// Shadow object for [Not].
363 class KernelNot extends Not implements KernelExpression {
364 KernelNot(Expression operand) : super(operand);
365
366 @override
367 DartType _inferExpression(
368 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
369 // TODO(scheglov): implement.
370 return typeNeeded ? const DynamicType() : null;
371 }
372 }
373
199 /// Concrete shadow object representing a null literal in kernel form. 374 /// Concrete shadow object representing a null literal in kernel form.
200 class KernelNullLiteral extends NullLiteral implements KernelExpression { 375 class KernelNullLiteral extends NullLiteral implements KernelExpression {
201 @override 376 @override
202 DartType _inferExpression( 377 DartType _inferExpression(
203 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 378 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
204 // TODO(paulberry): implement. 379 // TODO(paulberry): implement.
205 return typeNeeded ? const DynamicType() : null; 380 return typeNeeded ? const DynamicType() : null;
206 } 381 }
207 } 382 }
208 383
384 /// Shadow object for [PropertyGet].
385 class KernelPropertyGet extends PropertyGet implements KernelExpression {
386 KernelPropertyGet(Expression receiver, Name name) : super(receiver, name);
387
388 KernelPropertyGet.byReference(
389 Expression receiver, Name name, Reference interfaceTargetReference)
390 : super.byReference(receiver, name, interfaceTargetReference);
391
392 @override
393 DartType _inferExpression(
394 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
395 // TODO(scheglov): implement.
396 return typeNeeded ? const DynamicType() : null;
397 }
398 }
399
400 /// Shadow object for [PropertyGet].
401 class KernelPropertySet extends PropertySet implements KernelExpression {
402 KernelPropertySet(Expression receiver, Name name, Expression value)
403 : super(receiver, name, value);
404
405 KernelPropertySet.byReference(Expression receiver, Name name,
406 Expression value, Reference interfaceTargetReference)
407 : super.byReference(receiver, name, value, interfaceTargetReference);
408
409 @override
410 DartType _inferExpression(
411 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
412 // TODO(scheglov): implement.
413 return typeNeeded ? const DynamicType() : null;
414 }
415 }
416
417 /// Shadow object for [Rethrow].
418 class KernelRethrow extends Rethrow implements KernelExpression {
419 @override
420 DartType _inferExpression(
421 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
422 // TODO(scheglov): implement.
423 return typeNeeded ? const DynamicType() : null;
424 }
425 }
426
209 /// Concrete shadow object representing a return statement in kernel form. 427 /// Concrete shadow object representing a return statement in kernel form.
210 class KernelReturnStatement extends ReturnStatement implements KernelStatement { 428 class KernelReturnStatement extends ReturnStatement implements KernelStatement {
211 KernelReturnStatement([KernelExpression expression]) : super(expression); 429 KernelReturnStatement([KernelExpression expression]) : super(expression);
212 430
213 @override 431 @override
214 void _inferStatement(KernelTypeInferrer inferrer) { 432 void _inferStatement(KernelTypeInferrer inferrer) {
215 // TODO(paulberry): implement. 433 // TODO(paulberry): implement.
216 } 434 }
217 } 435 }
218 436
(...skipping 10 matching lines...) Expand all
229 class KernelStaticGet extends StaticGet implements KernelExpression { 447 class KernelStaticGet extends StaticGet implements KernelExpression {
230 KernelStaticGet(Member target) : super(target); 448 KernelStaticGet(Member target) : super(target);
231 449
232 @override 450 @override
233 DartType _inferExpression( 451 DartType _inferExpression(
234 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 452 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
235 return inferrer.inferStaticGet(typeContext, typeNeeded, target.getterType); 453 return inferrer.inferStaticGet(typeContext, typeNeeded, target.getterType);
236 } 454 }
237 } 455 }
238 456
457 /// Shadow object for [StaticInvocation].
458 class KernelStaticInvocation extends StaticInvocation
459 implements KernelExpression {
460 KernelStaticInvocation(Procedure target, Arguments arguments,
461 {bool isConst: false})
462 : super(target, arguments, isConst: isConst);
463
464 KernelStaticInvocation.byReference(
465 Reference targetReference, Arguments arguments)
466 : super.byReference(targetReference, arguments);
467
468 @override
469 DartType _inferExpression(
470 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
471 // TODO(scheglov): implement.
472 return typeNeeded ? const DynamicType() : null;
473 }
474 }
475
476 /// Shadow object for [StaticSet].
477 class KernelStaticSet extends StaticSet implements KernelExpression {
478 KernelStaticSet(Member target, Expression value) : super(target, value);
479
480 KernelStaticSet.byReference(Reference targetReference, Expression value)
481 : super.byReference(targetReference, value);
482
483 @override
484 DartType _inferExpression(
485 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
486 // TODO(scheglov): implement.
487 return typeNeeded ? const DynamicType() : null;
488 }
489 }
490
239 /// Concrete shadow object representing a string concatenation in kernel form. 491 /// Concrete shadow object representing a string concatenation in kernel form.
240 class KernelStringConcatenation extends StringConcatenation 492 class KernelStringConcatenation extends StringConcatenation
241 implements KernelExpression { 493 implements KernelExpression {
242 KernelStringConcatenation(List<Expression> expressions) : super(expressions); 494 KernelStringConcatenation(List<Expression> expressions) : super(expressions);
243 495
244 @override 496 @override
245 DartType _inferExpression( 497 DartType _inferExpression(
246 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 498 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
247 // TODO(scheglov) Add and use inferStringConcatenation() instead. 499 // TODO(scheglov) Add and use inferStringConcatenation() instead.
248 return inferrer.inferStringLiteral(typeContext, typeNeeded); 500 return inferrer.inferStringLiteral(typeContext, typeNeeded);
249 } 501 }
250 } 502 }
251 503
252 /// Concrete shadow object representing a string literal in kernel form. 504 /// Concrete shadow object representing a string literal in kernel form.
253 class KernelStringLiteral extends StringLiteral implements KernelExpression { 505 class KernelStringLiteral extends StringLiteral implements KernelExpression {
254 KernelStringLiteral(String value) : super(value); 506 KernelStringLiteral(String value) : super(value);
255 507
256 @override 508 @override
257 DartType _inferExpression( 509 DartType _inferExpression(
258 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 510 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
259 return inferrer.inferStringLiteral(typeContext, typeNeeded); 511 return inferrer.inferStringLiteral(typeContext, typeNeeded);
260 } 512 }
261 } 513 }
262 514
515 /// Shadow object for [SuperMethodInvocation].
516 class KernelSuperMethodInvocation extends SuperMethodInvocation
517 implements KernelExpression {
518 KernelSuperMethodInvocation(Name name, Arguments arguments,
519 [Procedure interfaceTarget])
520 : super(name, arguments, interfaceTarget);
521
522 KernelSuperMethodInvocation.byReference(
523 Name name, Arguments arguments, Reference interfaceTargetReference)
524 : super.byReference(name, arguments, interfaceTargetReference);
525
526 @override
527 DartType _inferExpression(
528 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
529 // TODO(scheglov): implement.
530 return typeNeeded ? const DynamicType() : null;
531 }
532 }
533
534 /// Shadow object for [SuperPropertyGet].
535 class KernelSuperPropertyGet extends SuperPropertyGet
536 implements KernelExpression {
537 KernelSuperPropertyGet(Name name, [Member interfaceTarget])
538 : super(name, interfaceTarget);
539
540 KernelSuperPropertyGet.byReference(
541 Name name, Reference interfaceTargetReference)
542 : super.byReference(name, interfaceTargetReference);
543
544 @override
545 DartType _inferExpression(
546 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
547 // TODO(scheglov): implement.
548 return typeNeeded ? const DynamicType() : null;
549 }
550 }
551
552 /// Shadow object for [SuperPropertySet].
553 class KernelSuperPropertySet extends SuperPropertySet
554 implements KernelExpression {
555 KernelSuperPropertySet(Name name, Expression value, Member interfaceTarget)
556 : super(name, value, interfaceTarget);
557
558 KernelSuperPropertySet.byReference(
559 Name name, Expression value, Reference interfaceTargetReference)
560 : super.byReference(name, value, interfaceTargetReference);
561
562 @override
563 DartType _inferExpression(
564 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
565 // TODO(scheglov): implement.
566 return typeNeeded ? const DynamicType() : null;
567 }
568 }
569
570 /// Shadow object for [SymbolLiteral].
571 class KernelSymbolLiteral extends SymbolLiteral implements KernelExpression {
572 KernelSymbolLiteral(String value) : super(value);
573
574 @override
575 DartType _inferExpression(
576 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
577 // TODO(scheglov): implement.
578 return typeNeeded ? const DynamicType() : null;
579 }
580 }
581
582 /// Shadow object for [ThisExpression].
583 class KernelThisExpression extends ThisExpression implements KernelExpression {
584 @override
585 DartType _inferExpression(
586 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
587 // TODO(scheglov): implement.
588 return typeNeeded ? const DynamicType() : null;
589 }
590 }
591
592 /// Shadow object for [Throw].
593 class KernelThrow extends Throw implements KernelExpression {
594 KernelThrow(Expression expression) : super(expression);
595
596 @override
597 DartType _inferExpression(
598 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
599 // TODO(scheglov): implement.
600 return typeNeeded ? const DynamicType() : null;
601 }
602 }
603
263 /// Concrete implementation of [TypeInferenceEngine] specialized to work with 604 /// Concrete implementation of [TypeInferenceEngine] specialized to work with
264 /// kernel objects. 605 /// kernel objects.
265 class KernelTypeInferenceEngine extends TypeInferenceEngineImpl<KernelField> { 606 class KernelTypeInferenceEngine extends TypeInferenceEngineImpl<KernelField> {
266 KernelTypeInferenceEngine(Instrumentation instrumentation, bool strongMode) 607 KernelTypeInferenceEngine(Instrumentation instrumentation, bool strongMode)
267 : super(instrumentation, strongMode); 608 : super(instrumentation, strongMode);
268 609
269 @override 610 @override
270 void clearFieldInitializer(KernelField field) { 611 void clearFieldInitializer(KernelField field) {
271 field.initializer = null; 612 field.initializer = null;
272 } 613 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 return statement._inferStatement(this); 731 return statement._inferStatement(this);
391 } else { 732 } else {
392 // Encountered a statement type for which type inference is not yet 733 // Encountered a statement type for which type inference is not yet
393 // implemented, so just skip it for now. 734 // implemented, so just skip it for now.
394 // TODO(paulberry): once the BodyBuilder uses shadow classes for 735 // TODO(paulberry): once the BodyBuilder uses shadow classes for
395 // everything, this case should no longer be needed. 736 // everything, this case should no longer be needed.
396 } 737 }
397 } 738 }
398 } 739 }
399 740
741 /// Shadow object for [TypeLiteral].
742 class KernelTypeLiteral extends TypeLiteral implements KernelExpression {
743 KernelTypeLiteral(DartType type) : super(type);
744
745 @override
746 DartType _inferExpression(
747 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
748 // TODO(scheglov): implement.
749 return typeNeeded ? const DynamicType() : null;
750 }
751 }
752
400 /// Concrete implementation of [TypePromoter] specialized to work with kernel 753 /// Concrete implementation of [TypePromoter] specialized to work with kernel
401 /// objects. 754 /// objects.
402 /// 755 ///
403 /// Note: the second type parameter really ought to be 756 /// Note: the second type parameter really ought to be
404 /// KernelVariableDeclaration, but we can't do that yet because BodyBuilder 757 /// KernelVariableDeclaration, but we can't do that yet because BodyBuilder
405 /// still uses raw VariableDeclaration objects sometimes. 758 /// still uses raw VariableDeclaration objects sometimes.
406 /// TODO(paulberry): fix this. 759 /// TODO(paulberry): fix this.
407 class KernelTypePromoter 760 class KernelTypePromoter
408 extends TypePromoterImpl<Expression, VariableDeclaration> { 761 extends TypePromoterImpl<Expression, VariableDeclaration> {
409 @override 762 @override
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // KernelVariableDeclaration. 874 // KernelVariableDeclaration.
522 mutatedInClosure = true; 875 mutatedInClosure = true;
523 declaredType = variable.type; 876 declaredType = variable.type;
524 } 877 }
525 return inferrer.inferVariableGet(typeContext, typeNeeded, mutatedInClosure, 878 return inferrer.inferVariableGet(typeContext, typeNeeded, mutatedInClosure,
526 _fact, _scope, fileOffset, declaredType, (type) { 879 _fact, _scope, fileOffset, declaredType, (type) {
527 promotedType = type; 880 promotedType = type;
528 }); 881 });
529 } 882 }
530 } 883 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/kernel_ast_factory.dart ('k') | pkg/front_end/lib/src/fasta/parser/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698