aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Mode.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-31 12:09:34 +0100
committerMartin Odersky <odersky@gmail.com>2013-10-31 12:09:56 +0100
commitcfbf68f7226ee770fd2d8fb0b8b3b4ac393630fa (patch)
treee14a213fd41e88658895524c56dcf3cf15e6c78e /src/dotty/tools/dotc/typer/Mode.scala
parentd8c1a0d6f26b4a2d7fcba98f1b4bb7ec1310780c (diff)
downloaddotty-cfbf68f7226ee770fd2d8fb0b8b3b4ac393630fa.tar.gz
dotty-cfbf68f7226ee770fd2d8fb0b8b3b4ac393630fa.tar.bz2
dotty-cfbf68f7226ee770fd2d8fb0b8b3b4ac393630fa.zip
Two fixes for implicit search
1. More refined criterion when to interpolate a typevar. The problem is that when typing an application of polymorphic implicit conversion ICONV to some artument ARG, we'd get a term such as ICONV[TVAR](ARG) where the position of TVAR is the position of ARG. At first, this meant that TVAR got interpolated already for ARG, which is clearly wrong. So we changed the algorithm to require strict inclusion, i.e. ARG.pos properly contains TVAr.pos, but then varianbles were interpolated needelessly late. Now, the typeImplicit prevents interpolation but the subsequent interpolateAndAdapt allows it. 2. Fresh contexts are now generated for each test in "refMatches" which avoids previous cross talk between constraints and constraint size blow ups.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Mode.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Mode.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Mode.scala b/src/dotty/tools/dotc/typer/Mode.scala
index 1890822b6..e126a794d 100644
--- a/src/dotty/tools/dotc/typer/Mode.scala
+++ b/src/dotty/tools/dotc/typer/Mode.scala
@@ -31,6 +31,7 @@ object Mode {
val ImplicitsEnabled = newMode(2, "ImplicitsEnabled")
val InSuperInit = newMode(3, "InSuperInit")
+ val RestrictedInterpolation = newMode(4, "RestrictedInterpolation")
val PatternOrType = Pattern | Type
} \ No newline at end of file