diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 9 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 3 | ||||
-rw-r--r-- | src/library/scala/runtime/RichDouble.scala | 2 | ||||
-rw-r--r-- | src/library/scala/runtime/RichFloat.scala | 2 |
4 files changed, 14 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) => diff --git a/src/library/scala/runtime/RichDouble.scala b/src/library/scala/runtime/RichDouble.scala index 8db1fd6b35..c4bd0c589f 100644 --- a/src/library/scala/runtime/RichDouble.scala +++ b/src/library/scala/runtime/RichDouble.scala @@ -24,6 +24,8 @@ final class RichDouble(x: Double) extends Proxy with Ordered[Double] { def max(y: Double): Double = Math.max(x, y) def abs: Double = Math.abs(x) + def round: Long = Math.round(x) + // isNaN is provided by the implicit conversion to java.lang.Double // def isNaN: Boolean = java.lang.Double.isNaN(x) def isInfinity: Boolean = java.lang.Double.isInfinite(x) diff --git a/src/library/scala/runtime/RichFloat.scala b/src/library/scala/runtime/RichFloat.scala index 8c6a3f6523..3a65b7443b 100644 --- a/src/library/scala/runtime/RichFloat.scala +++ b/src/library/scala/runtime/RichFloat.scala @@ -24,6 +24,8 @@ final class RichFloat(x: Float) extends Proxy with Ordered[Float] { def max(y: Float) = Math.max(x, y) def abs: Float = Math.abs(x) + def round: int = Math.round(x) + // isNaN is provided by the implicit conversion to java.lang.Float // def isNaN: Boolean = java.lang.Float.isNaN(x) def isInfinity: Boolean = java.lang.Float.isInfinite(x) |