@@ -32,7 +32,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
32
32
case ap @ Apply (i @ Ident (_), Nil ) if isCaseLabel(i.symbol) || isMatchEndLabel(i.symbol) =>
33
33
currentTransformState.labelDefStates.get(i.symbol) match {
34
34
case Some (state) =>
35
- Block (StateTransitionStyle .UpdateAndContinue .trees(state, new StateSet ), typed (literalUnit)).setType(definitions.UnitTpe )
35
+ Block (StateTransitionStyle .UpdateAndContinue .trees(state, new StateSet ), typedCurrentPos (literalUnit)).setType(definitions.UnitTpe )
36
36
case None => ap
37
37
}
38
38
case tree => tree
@@ -60,7 +60,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
60
60
val stats1 = mutable.ListBuffer [Tree ]()
61
61
def addNullAssigments (syms : Iterator [Symbol ]): Unit = {
62
62
for (fieldSym <- syms) {
63
- stats1 += typed (Assign (currentTransformState.memberRef(fieldSym), gen.mkZero(fieldSym.info)))
63
+ stats1 += typedCurrentPos (Assign (currentTransformState.memberRef(fieldSym), gen.mkZero(fieldSym.info)))
64
64
}
65
65
}
66
66
// Add pre-state null assigments at the beginning.
@@ -148,7 +148,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
148
148
}
149
149
150
150
allNextStates += nextState
151
- stats += typed (Return (literalUnit).setSymbol(currentTransformState.applySym))
151
+ stats += typedCurrentPos (Return (literalUnit).setSymbol(currentTransformState.applySym))
152
152
}
153
153
if (state == StateAssigner .Terminal ) {
154
154
// noop
@@ -462,7 +462,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
462
462
val asyncStatesInit = asyncStates.init // drop the terminal state which has no code.
463
463
val throww = Throw (Apply (Select (New (Ident (IllegalStateExceptionClass )), IllegalStateExceptionClass_NEW_String ), List (gen.mkMethodCall(currentRun.runDefinitions.String_valueOf_Int , stateMemberRef :: Nil ))))
464
464
val body =
465
- typed (Match (stateMemberRef,
465
+ typedBasePos (Match (stateMemberRef,
466
466
asyncStatesInit.map(_.mkHandlerCaseForState) ++
467
467
List (CaseDef (Ident (nme.WILDCARD ), EmptyTree ,
468
468
throww))))
@@ -480,7 +480,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
480
480
)
481
481
), EmptyTree )
482
482
}
483
- typed (LabelDef (transformState.whileLabel, Nil , Block (stateMatch :: Nil , Apply (Ident (transformState.whileLabel), Nil ))))
483
+ typedBasePos (LabelDef (transformState.whileLabel, Nil , Block (stateMatch :: Nil , Apply (Ident (transformState.whileLabel), Nil ))))
484
484
}
485
485
486
486
private def compactStates = true
@@ -557,7 +557,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
557
557
} else {
558
558
val temp = awaitableResult.symbol.newTermSymbol(nme.trGetResult).setInfo(definitions.ObjectTpe )
559
559
val tempVd = ValDef (temp, gen.mkMethodCall(currentTransformState.memberRef(currentTransformState.stateTryGet), tryyReference :: Nil ))
560
- typed (Block (
560
+ typedCurrentPos (Block (
561
561
tempVd :: Nil ,
562
562
If (Apply (gen.mkAttributedSelect(currentTransformState.stateMachineRef(), definitions.Object_eq ), gen.mkAttributedIdent(temp) :: Nil ),
563
563
Return (literalUnit),
@@ -571,7 +571,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
571
571
// Comlete the Promise in the `result` field with the final successful result of this async block.
572
572
private def completeSuccess (expr : Tree ): Tree = {
573
573
deriveTree(expr, definitions.UnitTpe ) { expr =>
574
- typed (Apply (currentTransformState.memberRef(currentTransformState.stateCompleteSuccess), expr :: Nil ))
574
+ typedCurrentPos (Apply (currentTransformState.memberRef(currentTransformState.stateCompleteSuccess), expr :: Nil ))
575
575
}
576
576
}
577
577
@@ -581,7 +581,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
581
581
protected def mkStateTree (nextState : Int ): Tree = {
582
582
val transformState = currentTransformState
583
583
val callSetter = Apply (transformState.memberRef(transformState.stateSetter), Literal (Constant (nextState)) :: Nil )
584
- typed (callSetter.updateAttachment(StateTransitionTree ))
584
+ typedCurrentPos (callSetter.updateAttachment(StateTransitionTree ))
585
585
}
586
586
}
587
587
@@ -625,9 +625,9 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
625
625
If (Apply (null_ne, Ident (transformState.applyTrParam) :: Nil ),
626
626
Apply (Ident (transformState.whileLabel), Nil ),
627
627
Block (toStats(callOnComplete(gen.mkAttributedIdent(tempAwaitableSym))), Return (literalUnit).setSymbol(transformState.applySym)))
628
- typed (initAwaitableTemp) :: typed (initTempCompleted) :: mkStateTree(nextState) :: typed (ifTree) :: Nil
628
+ typedCurrentPos (initAwaitableTemp) :: typedCurrentPos (initTempCompleted) :: mkStateTree(nextState) :: typedCurrentPos (ifTree) :: Nil
629
629
} else {
630
- mkStateTree(nextState) :: toStats(typed (callOnComplete(awaitable))) ::: typed (Return (literalUnit)) :: Nil
630
+ mkStateTree(nextState) :: toStats(typedCurrentPos (callOnComplete(awaitable))) ::: typedCurrentPos (Return (literalUnit)) :: Nil
631
631
}
632
632
}
633
633
}
@@ -636,7 +636,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
636
636
case object UpdateAndContinue extends StateTransitionStyle {
637
637
def trees (nextState : Int , stateSet : StateSet ): List [Tree ] = {
638
638
stateSet += nextState
639
- List (mkStateTree(nextState), typed (Apply (Ident (currentTransformState.whileLabel), Nil )))
639
+ List (mkStateTree(nextState), typedCurrentPos (Apply (Ident (currentTransformState.whileLabel), Nil )))
640
640
}
641
641
}
642
642
}
0 commit comments