aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r--src/dotty/tools/dotc/typer/Implicits.scala7
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