You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tree match {
casetree: Blockif (expr.tpe eq tree.expr.tpe) => tree1.withTypeUnchecked(tree.tpe)
case _ => ta.assignType(tree1, stats, expr)
}
This assumes that tree.tpe and tree.expr.tpe are in sync, but with a block like:
{
valy:Position=newPosition(1)
y
}
Then tree.expr.tpe will be a TermRef but tree.tpe will be a widened version of that type since the TermRef should not escape the scope of the block. This means that if the info of y is changed by DenotTransformer#transform:
tree.expr.tpe will still be a TermRef
tree.expr.tpe.widen will be changed
tree.tpe will not be changed, is now incorrect, and needs to be retyped.