summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-04-04 12:18:15 +0000
committerMartin Odersky <odersky@gmail.com>2006-04-04 12:18:15 +0000
commitac8b46abda17de619beb2b27dfe9d820c5e189cf (patch)
treeb908b07eb95280352dea767dd0fd8ac9890d8472 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent486042e89abaa69b82f2d602d342f7b032ce7047 (diff)
downloadscala-ac8b46abda17de619beb2b27dfe9d820c5e189cf.tar.gz
scala-ac8b46abda17de619beb2b27dfe9d820c5e189cf.tar.bz2
scala-ac8b46abda17de619beb2b27dfe9d820c5e189cf.zip
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 8637ff3a60..05dd710154 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -485,14 +485,17 @@ trait Typers requires Analyzer {
// adapt(tree, mode, pt)
// }
- def adaptToMember(qual: Tree, name: Name, tp: Type): Tree =
+ def adaptToMember(qual: Tree, name: Name, tp: Type): Tree = {
+ val qtpe = qual.tpe.widen;
if (qual.isTerm && (qual.symbol == null || qual.symbol.isValue) &&
- !phase.erasedTypes && !qual.tpe.widen.isError && !tp.isError) {
- val coercion = inferView(qual.pos, qual.tpe.widen, name, tp, true)
+ !phase.erasedTypes && !qtpe.isError && !tp.isError &&
+ qtpe.symbol != AllRefClass && qtpe.symbol != AllClass && qtpe != WildcardType) {
+ val coercion = inferView(qual.pos, qtpe, name, tp, true)
if (coercion != EmptyTree)
typedQualifier(atPos(qual.pos)(Apply(coercion, List(qual))))
else qual
} else qual
+ }
def adaptToName(qual: Tree, name: Name) =
if (qual.tpe.nonLocalMember(name) != NoSymbol) qual
@@ -911,7 +914,9 @@ trait Typers requires Analyzer {
val vparamSyms = List.map2(fun.vparams, argpts) { (vparam, argpt) =>
if (vparam.tpt.isEmpty)
vparam.tpt.tpe =
- if (argpt == NoType) { error(vparam.pos, "missing parameter type"); ErrorType }
+ if (argpt == NoType || argpt == WildcardType) {
+ error(vparam.pos, "missing parameter type"); ErrorType
+ }
else argpt
namer.enterSym(vparam)
vparam.symbol
@@ -1782,7 +1787,7 @@ trait Typers requires Analyzer {
def implicitsOfClass(clazz: Symbol): List[ImplicitInfo] = (
clazz.initialize.linkedModule.moduleClass.info.members.toList.filter(.hasFlag(IMPLICIT)) map
- (sym => ImplicitInfo(sym.name, clazz.linkedModule.tpe.memberType(sym), sym))
+ (sym => new ImplicitInfo(sym.name, clazz.linkedModule.tpe, sym))
)
var tree = searchImplicit(context.implicitss, true)