@@ -86,7 +86,7 @@ private[async] trait AnfTransform {
86
86
case Block (thenStats, thenExpr) => Block (thenStats, Assign (Ident (varDef.symbol), cast(thenExpr)))
87
87
case _ => Assign (Ident (varDef.symbol), cast(orig))
88
88
}
89
- }.setType(orig.tpe)
89
+ }
90
90
val ifWithAssign = treeCopy.If (tree, cond, branchWithAssign(thenp), branchWithAssign(elsep)).setType(definitions.UnitTpe )
91
91
stats :+ varDef :+ ifWithAssign :+ gen.mkAttributedStableRef(varDef.symbol).setType(tree.tpe).setPos(tree.pos)
92
92
}
@@ -104,10 +104,10 @@ private[async] trait AnfTransform {
104
104
val casesWithAssign = cases map {
105
105
case cd@ CaseDef (pat, guard, body) =>
106
106
val newBody = body match {
107
- case b@ Block (caseStats, caseExpr) => treeCopy.Block (b, caseStats, typedAssign(caseExpr))
107
+ case b@ Block (caseStats, caseExpr) => treeCopy.Block (b, caseStats, typedAssign(caseExpr)).setType(definitions. UnitTpe )
108
108
case _ => typedAssign(body)
109
109
}
110
- treeCopy.CaseDef (cd, pat, guard, newBody.setType(definitions. UnitTpe ) ).setType(definitions.UnitTpe )
110
+ treeCopy.CaseDef (cd, pat, guard, newBody).setType(definitions.UnitTpe )
111
111
}
112
112
val matchWithAssign = treeCopy.Match (tree, scrut, casesWithAssign).setType(definitions.UnitTpe )
113
113
require(matchWithAssign.tpe != null , matchWithAssign)
0 commit comments