Skip to content

Commit 317505e

Browse files
authored
Merge pull request #6782 from dotty-staging/fix-leak-checks
Fix leak checking
2 parents e0e1c80 + a38a6a7 commit 317505e

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
@@ -715,7 +715,7 @@ class Typer extends Namer
715715

716716
def escapingRefs(block: Tree, localSyms: => List[Symbol])(implicit ctx: Context): collection.Set[NamedType] = {
717717
lazy val locals = localSyms.toSet
718-
block.tpe namedPartsWith (tp => locals.contains(tp.symbol))
718+
block.tpe.namedPartsWith(tp => locals.contains(tp.symbol) && !tp.isErroneous)
719719
}
720720

721721
/** Ensure that an expression's type can be expressed without references to locally defined

0 commit comments

Comments
 (0)