diff options
author | Martin Odersky <odersky@gmail.com> | 2013-11-07 21:43:59 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-11-07 21:43:59 +0100 |
commit | 067ef2076cfcf7864b840ddf38c514ff67f52c64 (patch) | |
tree | 3b974ba717ecc08ab37d8dfb49c02f4f74d5eb5a /src/dotty/tools/dotc/typer/Implicits.scala | |
parent | 514801453e240610a0ba68fff7305355a7d204e1 (diff) | |
download | dotty-067ef2076cfcf7864b840ddf38c514ff67f52c64.tar.gz dotty-067ef2076cfcf7864b840ddf38c514ff67f52c64.tar.bz2 dotty-067ef2076cfcf7864b840ddf38c514ff67f52c64.zip |
Fixing inference problem and block scope problem
1. Typing blocks: forgot to create new scope. Now fixed.
2. The decitsion whether to interpolate a type variable was made based on the type variable's position and the current tree's position. This is too imprecise, because we might have auto-generated trees where all important parts have the same position. We now check for actual tree containment: A type variable can be interpolated for the type of a tree T if T contains the tree which introduced the type variable.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Implicits.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Implicits.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Implicits.scala b/src/dotty/tools/dotc/typer/Implicits.scala index e522727a0..78d3f15c1 100644 --- a/src/dotty/tools/dotc/typer/Implicits.scala +++ b/src/dotty/tools/dotc/typer/Implicits.scala @@ -298,7 +298,7 @@ trait Implicits { self: Typer => if (!argument.isEmpty) generated = typedUnadapted( untpd.Apply(untpd.TypedSplice(generated), untpd.TypedSplice(argument) :: Nil), - pt)(ctx.fresh.addMode(Mode.RestrictedInterpolation)) + pt) val generated1 = interpolateAndAdapt(generated, pt) lazy val shadowing = typed(untpd.Ident(ref.name) withPos pos.toSynthetic, ref)(nestedContext).tpe |