Skip to content

Commit cd74cac

Browse files
committed
Fix leak checking
When compiling Parsers.scala with mismatched braces, I saw ``` java.lang.AssertionError: assertion failed: leak: <error no implicit values were found that match type dotty.tools.dotc.core.Contexts.Context> [error] ( [error] vdef) in ... ``` The issue is here that we should disregard leaks with erroneous types.
1 parent e2f4070 commit cd74cac

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.widen.isErroneous)
719719
}
720720

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

0 commit comments

Comments
 (0)