aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-04-07 17:49:15 +0200
committerMartin Odersky <odersky@gmail.com>2016-04-07 17:51:55 +0200
commit422b06126d3809f4db11dba0988cd21857e1f9de (patch)
treecaf644d0c3a7e57fffb331ae34a6548fcdf0fe97 /src/dotty/tools/dotc/typer/Typer.scala
parent4ca4fa1b507995e9e554aff3b0c141cf89709dd5 (diff)
downloaddotty-422b06126d3809f4db11dba0988cd21857e1f9de.tar.gz
dotty-422b06126d3809f4db11dba0988cd21857e1f9de.tar.bz2
dotty-422b06126d3809f4db11dba0988cd21857e1f9de.zip
Search implicit arguments in the same context as typing explicit ones
For explicit arguments of this(...) constrictor calls we have a special context that hides members of the current class. But for implicit arguments we did not. This led to implicit shadowing errors for scala.collection.immutable.PagedSeq when secondary constructor type parameters were fixed (as done in subsequent commits).
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 3b8ada2a8..fac24e440 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -1518,7 +1518,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
val tvarsToInstantiate = tvarsInParams(tree)
wtp.paramTypes.foreach(instantiateSelected(_, tvarsToInstantiate))
val constr = ctx.typerState.constraint
- def addImplicitArgs = {
+ def addImplicitArgs(implicit ctx: Context) = {
val errors = new mutable.ListBuffer[() => String]
def implicitArgError(msg: => String) = {
errors += (() => msg)
@@ -1565,9 +1565,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
}
else adapt(tpd.Apply(tree, args), pt)
}
- if ((pt eq WildcardType) || original.isEmpty) addImplicitArgs
+ if ((pt eq WildcardType) || original.isEmpty) addImplicitArgs(argCtx(tree))
else
- ctx.typerState.tryWithFallback(addImplicitArgs) {
+ ctx.typerState.tryWithFallback(addImplicitArgs(argCtx(tree))) {
adapt(typed(original, WildcardType), pt, EmptyTree)
}
case wtp: MethodType if !pt.isInstanceOf[SingletonType] =>