diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index 4ba43db43..043ecd29f 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -34,8 +34,11 @@ object Implicits { def refs: Set[TermRef] /** Return those references in `refs` that are compatible with type `pt`. */ - protected def filterMatching(pt: Type)(implicit ctx: Context) = - refs.toList filter (ref => isCompatible(normalize(ref), pt)) + protected def filterMatching(pt: Type)(implicit ctx: Context) = { + def result(implicit ctx: Context) = + refs.toList filter (ref => isCompatible(normalize(ref), pt)) + result(ctx.fresh.withNewTyperState) + } /** No further implicit conversions can be applied when searching for implicits. */ override def viewExists(tp: Type, pt: Type)(implicit ctx: Context) = false |