diff options
author | Martin Odersky <odersky@gmail.com> | 2007-03-05 23:20:41 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-03-05 23:20:41 +0000 |
commit | 69a8cebb64fddaffe9059126cca0b35718d28bf8 (patch) | |
tree | 48d07fe33db25d63967b14d4d01ea090f22ca477 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 93119cb1e79ca49c816cb7428e68d159a48c0369 (diff) | |
download | scala-69a8cebb64fddaffe9059126cca0b35718d28bf8.tar.gz scala-69a8cebb64fddaffe9059126cca0b35718d28bf8.tar.bz2 scala-69a8cebb64fddaffe9059126cca0b35718d28bf8.zip |
fixed bugs 973,971,949,947,946,930
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index fbf78cbe7d..cbd691ae3d 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -2019,7 +2019,7 @@ trait Typers requires Analyzer { mkTypeBounds(AllClass.tpe, AnyClass.tpe) if (vble.name == nme.WILDCARD.toTypeName) context.scope.enter(vble) else namer.enterInScope(vble) - tree setType vble.tpe + tree setSymbol vble setType vble.tpe } else { if (vble == NoSymbol) vble = context.owner.newValue(tree.pos, name) @@ -2196,7 +2196,9 @@ trait Typers requires Analyzer { case Typed(expr, tpt) => val tpt1 = typedType(tpt) val expr1 = typed(expr, mode & stickyModes, tpt1.tpe.deconst) - val owntype = if ((mode & PATTERNmode) != 0) inferTypedPattern(tpt1.pos, tpt1.tpe, widen(pt)) else tpt1.tpe + val owntype = + if ((mode & PATTERNmode) != 0) inferTypedPattern(tpt1.pos, tpt1.tpe, widen(pt)) + else tpt1.tpe //Console.println(typed pattern: "+tree+":"+", tp = "+tpt1.tpe+", pt = "+pt+" ==> "+owntype)//DEBUG copy.Typed(tree, expr1, tpt1) setType owntype @@ -2359,6 +2361,15 @@ trait Typers requires Analyzer { val argtypes = args1 map (.tpe) val owntype = if (tpt1.symbol.isClass) appliedType(tpt1.tpe, argtypes) else tpt1.tpe.subst(tparams, argtypes) + List.map2(args, tparams) { (arg, tparam) => arg match { + // note: can't use args1 in selector, because Bind's got replaced + case Bind(_, _) => + if (arg.symbol.isAbstractType) + arg.symbol setInfo + TypeBounds(lub(List(arg.symbol.info.bounds.lo, tparam.info.bounds.lo)), + glb(List(arg.symbol.info.bounds.hi, tparam.info.bounds.hi))) + case _ => + }} TypeTree(owntype) setOriginal(tree) // setPos tree.pos } else if (tparams.length == 0) { errorTree(tree, tpt1.tpe+" does not take type parameters") |