diff options
author | Martin Odersky <odersky@gmail.com> | 2013-09-05 14:57:15 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-09-05 14:57:15 +0200 |
commit | 8857d1d0a613491ffc833f5252107551f570c074 (patch) | |
tree | 0db0ab1f72eed19c98f873ea1492f1296c2c15e2 /src/dotty/tools/dotc/typer | |
parent | 5bd9945e41f65b93f03543dbff3a4d7f531d6c3e (diff) | |
download | dotty-8857d1d0a613491ffc833f5252107551f570c074.tar.gz dotty-8857d1d0a613491ffc833f5252107551f570c074.tar.bz2 dotty-8857d1d0a613491ffc833f5252107551f570c074.zip |
Fix that avoids constraint pollution when computing cached scope implicits.
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-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 |