summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala9
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index d368ff37f5..66bdf9dfd1 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1042,7 +1042,10 @@ trait Types requires SymbolTable {
def transform(cl: Array[Type]): Array[Type] = {
val cl1 = new Array[Type](cl.length)
var i = 0
- while (i < cl.length) { cl1(i) = transform(cl(i)); i = i + 1 }
+ while (i < cl.length) {
+ cl1(i) = transform(cl(i))
+ i = i + 1
+ }
cl1
}
@@ -1789,7 +1792,9 @@ trait Types requires SymbolTable {
else subst(sym, from.tail, to.tail)
tp match {
case TypeRef(NoPrefix, sym, _) =>
- subst(sym, from, to)
+ val tp1 = subst(sym, from, to)
+ if (tp1 ne tp) tp1
+ else mapOver(tp)
case SingleType(NoPrefix, sym) =>
subst(sym, from, to)
case PolyType(tparams, restp) =>
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index ab4cf811fa..3ffb1e10bf 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1426,7 +1426,10 @@ trait Typers requires Analyzer {
}
fun.tpe match {
case OverloadedType(pre, alts) =>
+ val undetparams = context.undetparams
+ context.undetparams = List()
val args1 = typedArgs(args, mode)
+ context.undetparams = undetparams
inferMethodAlternative(fun, context.undetparams, args1 map (.tpe.deconst), pt)
typedApply(tree, adapt(fun, funMode(mode), WildcardType), args1, mode, pt)
case MethodType(formals0, restpe) =>