summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2010-03-08 13:43:12 +0000
committerMartin Odersky <odersky@gmail.com>2010-03-08 13:43:12 +0000
commit2b0dcfe63622e24dd03da82245cc584a146321c2 (patch)
tree2641bac8f551d65d94c9c65acf322d48a843011b /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent7144b4990f2c90002286ebf31a395c36024adcd2 (diff)
downloadscala-2b0dcfe63622e24dd03da82245cc584a146321c2.tar.gz
scala-2b0dcfe63622e24dd03da82245cc584a146321c2.tar.bz2
scala-2b0dcfe63622e24dd03da82245cc584a146321c2.zip
Closes #3006.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index d64fc26f15..4a29491cde 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -208,7 +208,7 @@ trait Typers { self: Analyzer =>
s traverse fun
for (arg <- args) s traverse arg
}
- Apply(fun, args) setPos fun.pos
+ new ApplyToImplicitArgs(fun, args) setPos fun.pos
case ErrorType =>
fun
}
@@ -1009,7 +1009,7 @@ trait Typers { self: Analyzer =>
if (coercion != EmptyTree) {
if (settings.debug.value) log("inferred view from "+tree.tpe+" to "+pt+" = "+coercion+":"+coercion.tpe)
return newTyper(context.makeImplicit(context.reportAmbiguousErrors)).typed(
- Apply(coercion, List(tree)) setPos tree.pos, mode, pt)
+ new ApplyImplicitView(coercion, List(tree)) setPos tree.pos, mode, pt)
}
}
}
@@ -1039,6 +1039,7 @@ trait Typers { self: Analyzer =>
((qual.symbol eq null) || !qual.symbol.isTerm || qual.symbol.isValue) &&
phase.id <= currentRun.typerPhase.id && !qtpe.isError &&
qtpe.typeSymbol != NullClass && qtpe.typeSymbol != NothingClass && qtpe != WildcardType &&
+ !qual.isInstanceOf[ApplyImplicitView] && // don't chain views
context.implicitsEnabled) { // don't try to adapt a top-level type that's the subject of an implicit search
// this happens because, if isView, typedImplicit tries to apply the "current" implicit value to
// a value that needs to be coerced, so we check whether the implicit value has an `apply` method
@@ -1050,7 +1051,7 @@ trait Typers { self: Analyzer =>
}
val coercion = inferView(qual, qtpe, searchTemplate, true)
if (coercion != EmptyTree)
- typedQualifier(atPos(qual.pos)(Apply(coercion, List(qual))))
+ typedQualifier(atPos(qual.pos)(new ApplyImplicitView(coercion, List(qual))))
else
qual
} else {
@@ -3979,7 +3980,7 @@ trait Typers { self: Analyzer =>
error(tree.pos, "cannot create a generic multi-dimensional array of more than "+MaxArrayDims+" dimensions")
val newArrayApp = atPos(tree.pos) {
val manif = getManifestTree(tree.pos, manifType, false)
- Apply(Select(manif, if (level == 1) "newArray" else "newArray"+level), args)
+ new ApplyToImplicitArgs(Select(manif, if (level == 1) "newArray" else "newArray"+level), args)
}
typed(newArrayApp, mode, pt)
case tree1 =>