Skip to content

Commit a547054

Browse files
committed
fix scala#1743: fix typing of ValDef with anonymous class
1 parent 566e8f7 commit a547054

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
588588
else pt.notApplied
589589
val expr1 = typedExpr(tree.expr, ept)(exprCtx)
590590
ensureNoLocalRefs(
591-
assignType(cpy.Block(tree)(stats1, expr1), stats1, expr1), pt, localSyms(stats1))
591+
assignType(cpy.Block(tree)(stats1, expr1), stats1, expr1), pt, localSyms(stats1).filter(_.isTerm))
592592
}
593593

594594
def escapingRefs(block: Tree, localSyms: => List[Symbol])(implicit ctx: Context): collection.Set[NamedType] = {

0 commit comments

Comments
 (0)