summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-03-15 14:25:51 +0000
committerMartin Odersky <odersky@gmail.com>2009-03-15 14:25:51 +0000
commitff9887891f8f865617c60351a3afc8daced2db0e (patch)
tree476ebe03d60807f0de5a41835efe9926faff5faa /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parenta14b43742168c3dae77cafeb2ed7862e8890945e (diff)
downloadscala-ff9887891f8f865617c60351a3afc8daced2db0e.tar.gz
scala-ff9887891f8f865617c60351a3afc8daced2db0e.tar.bz2
scala-ff9887891f8f865617c60351a3afc8daced2db0e.zip
Better inference for implicits; some preparatio...
Better inference for implicits; some preparations for new collections.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d878c3700d..955bd9ee4c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -746,12 +746,11 @@ trait Typers { self: Analyzer =>
adapt(tree1 setType restpe.substSym(tparams, tparams1), mode, pt)
case mt: ImplicitMethodType if ((mode & (EXPRmode | FUNmode | LHSmode)) == EXPRmode) => // (4.1)
if (!context.undetparams.isEmpty && (mode & POLYmode) == 0) { // (9)
- inferExprInstance(tree, context.extractUndetparams(), pt)
- adapt(tree, mode, pt)
- } else {
- val typer1 = constrTyperIf(treeInfo.isSelfOrSuperConstrCall(tree))
- typer1.typed(typer1.applyImplicitArgs(tree), mode, pt)
+ context.undetparams = inferExprInstance(
+ tree, context.extractUndetparams(), pt, false)
}
+ val typer1 = constrTyperIf(treeInfo.isSelfOrSuperConstrCall(tree))
+ typer1.typed(typer1.applyImplicitArgs(tree), mode, pt)
case mt: MethodType
if (((mode & (EXPRmode | FUNmode | LHSmode)) == EXPRmode) &&
(context.undetparams.isEmpty || (mode & POLYmode) != 0)) =>
@@ -936,7 +935,7 @@ trait Typers { self: Analyzer =>
* @return ...
*/
def instantiate(tree: Tree, mode: Int, pt: Type): Tree = {
- inferExprInstance(tree, context.extractUndetparams(), pt)
+ inferExprInstance(tree, context.extractUndetparams(), pt, true)
adapt(tree, mode, pt)
}
@@ -1906,7 +1905,7 @@ trait Typers { self: Analyzer =>
} else if (needsInstantiation(tparams, formals, args1)) {
//println("needs inst "+fun+" "+tparams+"/"+(tparams map (_.info)))
- inferExprInstance(fun, tparams, WildcardType)
+ inferExprInstance(fun, tparams, WildcardType, true)
doTypedApply(tree, fun, args1, mode, pt)
} else {
assert((mode & PATTERNmode) == 0); // this case cannot arise for patterns