@@ -127,12 +127,12 @@ private[async] trait AnfTransform {
127127 private object trace {
128128 private var indent = - 1
129129
130- def indentString = " " * indent
130+ private def indentString = " " * indent
131131
132132 def apply [T ](args : Any )(t : => T ): T = {
133133 def prefix = mode.toString.toLowerCase
134134 indent += 1
135- def oneLine (s : Any ) = s.toString.replaceAll( """ \n""" , " \\\\ n" ).take(127 )
135+ def oneLine (s : Any ) = s.toString.replaceAll(""" \n""" , " \\\\ n" ).take(127 )
136136 try {
137137 AsyncUtils .trace(s " ${indentString}$prefix( ${oneLine(args)}) " )
138138 val result = t
@@ -173,7 +173,7 @@ private[async] trait AnfTransform {
173173 stats :+ treeCopy.Typed (tree, expr1, tpt)
174174
175175 case treeInfo.Applied (fun, targs, argss) if argss.nonEmpty =>
176- // we an assume that no await call appears in a by-name argument position,
176+ // we can assume that no await call appears in a by-name argument position,
177177 // this has already been checked.
178178 val funStats :+ simpleFun = linearize.transformToList(fun)
179179 val (argStatss, argExprss): (List [List [List [Tree ]]], List [List [Tree ]]) =
@@ -221,14 +221,7 @@ private[async] trait AnfTransform {
221221 val condStats :+ condExpr = linearize.transformToList(cond)
222222 val thenBlock = linearize.transformToBlock(thenp)
223223 val elseBlock = linearize.transformToBlock(elsep)
224- // Typechecking with `condExpr` as the condition fails if the condition
225- // contains an await. `ifTree.setType(tree.tpe)` also fails; it seems
226- // we rely on this call to `typeCheck` descending into the branches.
227- // But, we can get away with typechecking a throwaway `If` tree with the
228- // original scrutinee and the new branches, and setting that type on
229- // the real `If` tree.
230- val iff = treeCopy.If (tree, condExpr, thenBlock, elseBlock)
231- condStats :+ iff
224+ condStats :+ treeCopy.If (tree, condExpr, thenBlock, elseBlock)
232225
233226 case Match (scrut, cases) =>
234227 val scrutStats :+ scrutExpr = linearize.transformToList(scrut)
@@ -248,9 +241,7 @@ private[async] trait AnfTransform {
248241 val newBlock = treeCopy.Block (b, valDefs ++ stats1, expr1)
249242 treeCopy.CaseDef (tree, pat, guard, newBlock)
250243 }
251- // Refer to comments the translation of `If` above.
252- val typedMatch = treeCopy.Match (tree, scrutExpr, caseDefs)
253- scrutStats :+ typedMatch
244+ scrutStats :+ treeCopy.Match (tree, scrutExpr, caseDefs)
254245
255246 case LabelDef (name, params, rhs) =>
256247 List (LabelDef (name, params, Block (linearize.transformToList(rhs), Literal (Constant (())))).setSymbol(tree.symbol))
0 commit comments