@@ -32,7 +32,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
3232 case ap @ Apply (i @ Ident (_), Nil ) if isCaseLabel(i.symbol) || isMatchEndLabel(i.symbol) =>
3333 currentTransformState.labelDefStates.get(i.symbol) match {
3434 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 )
3636 case None => ap
3737 }
3838 case tree => tree
@@ -60,7 +60,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
6060 val stats1 = mutable.ListBuffer [Tree ]()
6161 def addNullAssigments (syms : Iterator [Symbol ]): Unit = {
6262 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)))
6464 }
6565 }
6666 // Add pre-state null assigments at the beginning.
@@ -148,7 +148,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
148148 }
149149
150150 allNextStates += nextState
151- stats += typed (Return (literalUnit).setSymbol(currentTransformState.applySym))
151+ stats += typedCurrentPos (Return (literalUnit).setSymbol(currentTransformState.applySym))
152152 }
153153 if (state == StateAssigner .Terminal ) {
154154 // noop
@@ -462,7 +462,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
462462 val asyncStatesInit = asyncStates.init // drop the terminal state which has no code.
463463 val throww = Throw (Apply (Select (New (Ident (IllegalStateExceptionClass )), IllegalStateExceptionClass_NEW_String ), List (gen.mkMethodCall(currentRun.runDefinitions.String_valueOf_Int , stateMemberRef :: Nil ))))
464464 val body =
465- typed (Match (stateMemberRef,
465+ typedBasePos (Match (stateMemberRef,
466466 asyncStatesInit.map(_.mkHandlerCaseForState) ++
467467 List (CaseDef (Ident (nme.WILDCARD ), EmptyTree ,
468468 throww))))
@@ -480,7 +480,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
480480 )
481481 ), EmptyTree )
482482 }
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 ))))
484484 }
485485
486486 private def compactStates = true
@@ -557,7 +557,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
557557 } else {
558558 val temp = awaitableResult.symbol.newTermSymbol(nme.trGetResult).setInfo(definitions.ObjectTpe )
559559 val tempVd = ValDef (temp, gen.mkMethodCall(currentTransformState.memberRef(currentTransformState.stateTryGet), tryyReference :: Nil ))
560- typed (Block (
560+ typedCurrentPos (Block (
561561 tempVd :: Nil ,
562562 If (Apply (gen.mkAttributedSelect(currentTransformState.stateMachineRef(), definitions.Object_eq ), gen.mkAttributedIdent(temp) :: Nil ),
563563 Return (literalUnit),
@@ -571,7 +571,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
571571 // Comlete the Promise in the `result` field with the final successful result of this async block.
572572 private def completeSuccess (expr : Tree ): Tree = {
573573 deriveTree(expr, definitions.UnitTpe ) { expr =>
574- typed (Apply (currentTransformState.memberRef(currentTransformState.stateCompleteSuccess), expr :: Nil ))
574+ typedCurrentPos (Apply (currentTransformState.memberRef(currentTransformState.stateCompleteSuccess), expr :: Nil ))
575575 }
576576 }
577577
@@ -581,7 +581,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
581581 protected def mkStateTree (nextState : Int ): Tree = {
582582 val transformState = currentTransformState
583583 val callSetter = Apply (transformState.memberRef(transformState.stateSetter), Literal (Constant (nextState)) :: Nil )
584- typed (callSetter.updateAttachment(StateTransitionTree ))
584+ typedCurrentPos (callSetter.updateAttachment(StateTransitionTree ))
585585 }
586586 }
587587
@@ -625,9 +625,9 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
625625 If (Apply (null_ne, Ident (transformState.applyTrParam) :: Nil ),
626626 Apply (Ident (transformState.whileLabel), Nil ),
627627 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
629629 } else {
630- mkStateTree(nextState) :: toStats(typed (callOnComplete(awaitable))) ::: typed (Return (literalUnit)) :: Nil
630+ mkStateTree(nextState) :: toStats(typedCurrentPos (callOnComplete(awaitable))) ::: typedCurrentPos (Return (literalUnit)) :: Nil
631631 }
632632 }
633633 }
@@ -636,7 +636,7 @@ trait ExprBuilder extends TransformUtils with AsyncAnalysis {
636636 case object UpdateAndContinue extends StateTransitionStyle {
637637 def trees (nextState : Int , stateSet : StateSet ): List [Tree ] = {
638638 stateSet += nextState
639- List (mkStateTree(nextState), typed (Apply (Ident (currentTransformState.whileLabel), Nil )))
639+ List (mkStateTree(nextState), typedCurrentPos (Apply (Ident (currentTransformState.whileLabel), Nil )))
640640 }
641641 }
642642 }
0 commit comments