@@ -535,7 +535,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
535
535
// Error reporting and recovery is handled elsewhere.
536
536
} else {
537
537
field.initializer = initializer;
538
- _typeInferrer.inferFieldInitializer (
538
+ _typeInferrer? .inferFieldInitializer (
539
539
this ,
540
540
field.hasTypeInferredFromInitializer ? null : field.builtType,
541
541
initializer);
@@ -554,7 +554,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
554
554
}
555
555
List <Expression > annotations = pop ();
556
556
if (annotations != null ) {
557
- _typeInferrer.inferMetadata (this , annotations);
557
+ _typeInferrer? .inferMetadata (this , annotations);
558
558
Field field = fields.first.target;
559
559
// The first (and often only field) will not get a clone.
560
560
for (int i = 0 ; i < annotations.length; i++ ) {
@@ -684,7 +684,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
684
684
}
685
685
initializer = buildInvalidInitializer (node, token.charOffset);
686
686
}
687
- _typeInferrer.inferInitializer (this , initializer);
687
+ _typeInferrer? .inferInitializer (this , initializer);
688
688
if (member is KernelConstructorBuilder && ! member.isExternal) {
689
689
member.addInitializer (initializer, this );
690
690
} else {
@@ -709,7 +709,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
709
709
void finishFunction (List <Expression > annotations, FormalParameters formals,
710
710
AsyncMarker asyncModifier, Statement body) {
711
711
debugEvent ("finishFunction" );
712
- typePromoter.finished ();
712
+ typePromoter? .finished ();
713
713
714
714
KernelFunctionBuilder builder = member;
715
715
if (formals? .parameters != null ) {
@@ -723,13 +723,13 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
723
723
// https://github.com/dart-lang/sdk/issues/32289
724
724
null );
725
725
realParameter.initializer = initializer..parent = realParameter;
726
- _typeInferrer.inferParameterInitializer (
726
+ _typeInferrer? .inferParameterInitializer (
727
727
this , initializer, realParameter.type);
728
728
}
729
729
}
730
730
}
731
731
732
- _typeInferrer.inferFunctionBody (
732
+ _typeInferrer? .inferFunctionBody (
733
733
this , _computeReturnTypeContext (member), asyncModifier, body);
734
734
735
735
// For async, async*, and sync* functions with declared return types, we
@@ -832,7 +832,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
832
832
}
833
833
}
834
834
Member target = builder.target;
835
- _typeInferrer.inferMetadata (this , annotations);
835
+ _typeInferrer? .inferMetadata (this , annotations);
836
836
for (Expression annotation in annotations ?? const []) {
837
837
target.addAnnotation (annotation);
838
838
}
@@ -971,7 +971,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
971
971
@override
972
972
List <Expression > finishMetadata (TreeNode parent) {
973
973
List <Expression > expressions = pop ();
974
- _typeInferrer.inferMetadata (this , expressions);
974
+ _typeInferrer? .inferMetadata (this , expressions);
975
975
976
976
// The invocation of [resolveRedirectingFactoryTargets] below may change the
977
977
// root nodes of the annotation expressions. We need to have a parent of
@@ -1061,7 +1061,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
1061
1061
1062
1062
ReturnJudgment fakeReturn = new ReturnJudgment (null , expression);
1063
1063
1064
- _typeInferrer.inferFunctionBody (
1064
+ _typeInferrer? .inferFunctionBody (
1065
1065
this , const DynamicType (), AsyncMarker .Sync , fakeReturn);
1066
1066
1067
1067
return fakeReturn.expression;
@@ -1287,7 +1287,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
1287
1287
void beginBinaryExpression (Token token) {
1288
1288
if (optional ("&&" , token) || optional ("||" , token)) {
1289
1289
Expression lhs = popForValue ();
1290
- typePromoter.enterLogicalExpression (lhs, token.stringValue);
1290
+ typePromoter? .enterLogicalExpression (lhs, token.stringValue);
1291
1291
push (lhs);
1292
1292
}
1293
1293
}
@@ -1341,7 +1341,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
1341
1341
Expression receiver = pop ();
1342
1342
Expression logicalExpression =
1343
1343
forest.logicalExpression (receiver, token, argument);
1344
- typePromoter.exitLogicalExpression (argument, logicalExpression);
1344
+ typePromoter? .exitLogicalExpression (argument, logicalExpression);
1345
1345
push (logicalExpression);
1346
1346
}
1347
1347
@@ -1709,9 +1709,9 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
1709
1709
// [ProcedureBuilder.computeFormalParameterInitializerScope]. If that
1710
1710
// wasn't the case, we could always use [VariableUseGenerator].
1711
1711
if (declaration.isFinal) {
1712
- Object fact = typePromoter.getFactForAccess (
1712
+ Object fact = typePromoter? .getFactForAccess (
1713
1713
declaration.target, functionNestingLevel);
1714
- Object scope = typePromoter.currentScope;
1714
+ Object scope = typePromoter? .currentScope;
1715
1715
return new ReadOnlyAccessGenerator (
1716
1716
this ,
1717
1717
token,
@@ -1946,7 +1946,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
1946
1946
1947
1947
@override
1948
1948
void endThenStatement (Token token) {
1949
- typePromoter.enterElse ();
1949
+ typePromoter? .enterElse ();
1950
1950
super .endThenStatement (token);
1951
1951
}
1952
1952
@@ -1955,7 +1955,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
1955
1955
Statement elsePart = popStatementIfNotNull (elseToken);
1956
1956
Statement thenPart = popStatement ();
1957
1957
Expression condition = pop ();
1958
- typePromoter.exitConditional ();
1958
+ typePromoter? .exitConditional ();
1959
1959
push (forest.ifStatement (ifToken, condition, thenPart, elseToken, elsePart));
1960
1960
}
1961
1961
@@ -2544,7 +2544,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
2544
2544
forest.isExpression (operand, isOperator, not, type);
2545
2545
library.checkBoundsInType (type, typeEnvironment, isOperator.charOffset);
2546
2546
if (operand is VariableGet ) {
2547
- typePromoter.handleIsCheck (isExpression, isInverted, operand.variable,
2547
+ typePromoter? .handleIsCheck (isExpression, isInverted, operand.variable,
2548
2548
type, functionNestingLevel);
2549
2549
}
2550
2550
if (constantContext != ConstantContext .none) {
@@ -2562,15 +2562,15 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
2562
2562
@override
2563
2563
void beginConditionalExpression (Token question) {
2564
2564
Expression condition = popForValue ();
2565
- typePromoter.enterThen (condition);
2565
+ typePromoter? .enterThen (condition);
2566
2566
push (condition);
2567
2567
super .beginConditionalExpression (question);
2568
2568
}
2569
2569
2570
2570
@override
2571
2571
void handleConditionalExpressionColon () {
2572
2572
Expression then = popForValue ();
2573
- typePromoter.enterElse ();
2573
+ typePromoter? .enterElse ();
2574
2574
push (then);
2575
2575
super .handleConditionalExpressionColon ();
2576
2576
}
@@ -2581,7 +2581,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
2581
2581
Expression elseExpression = popForValue ();
2582
2582
Expression thenExpression = pop ();
2583
2583
Expression condition = pop ();
2584
- typePromoter.exitConditional ();
2584
+ typePromoter? .exitConditional ();
2585
2585
push (forest.conditionalExpression (
2586
2586
condition, question, thenExpression, colon, elseExpression));
2587
2587
}
@@ -2671,7 +2671,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
2671
2671
}
2672
2672
if (annotations != null ) {
2673
2673
if (functionNestingLevel == 0 ) {
2674
- _typeInferrer.inferMetadata (this , annotations);
2674
+ _typeInferrer? .inferMetadata (this , annotations);
2675
2675
}
2676
2676
for (Expression annotation in annotations) {
2677
2677
variable.addAnnotation (annotation);
@@ -3714,8 +3714,8 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
3714
3714
variable =
3715
3715
new VariableDeclarationJudgment .forValue (null , functionNestingLevel);
3716
3716
TypePromotionFact fact =
3717
- typePromoter.getFactForAccess (variable, functionNestingLevel);
3718
- TypePromotionScope scope = typePromoter.currentScope;
3717
+ typePromoter? .getFactForAccess (variable, functionNestingLevel);
3718
+ TypePromotionScope scope = typePromoter? .currentScope;
3719
3719
syntheticAssignment = lvalue.buildAssignment (
3720
3720
new VariableGetJudgment (variable, fact, scope)
3721
3721
..fileOffset = inKeyword.offset,
@@ -4141,7 +4141,7 @@ abstract class BodyBuilder extends ScopeListener<JumpTarget>
4141
4141
KernelTypeVariableBuilder variable = new KernelTypeVariableBuilder (
4142
4142
name.name, library, name.charOffset, null );
4143
4143
if (annotations != null ) {
4144
- _typeInferrer.inferMetadata (this , annotations);
4144
+ _typeInferrer? .inferMetadata (this , annotations);
4145
4145
for (Expression annotation in annotations) {
4146
4146
variable.parameter.addAnnotation (annotation);
4147
4147
}
0 commit comments