summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-03-19 14:18:43 +0000
committerMartin Odersky <odersky@gmail.com>2007-03-19 14:18:43 +0000
commitcb08c06766425cc18aee02a0ebc0ccd395a5ed5f (patch)
tree988c16339f3d782e1ac28cd854d041c4149bd71f /src/compiler
parent3ee224f431b2563391e148d2a954d52308b67192 (diff)
downloadscala-cb08c06766425cc18aee02a0ebc0ccd395a5ed5f.tar.gz
scala-cb08c06766425cc18aee02a0ebc0ccd395a5ed5f.tar.bz2
scala-cb08c06766425cc18aee02a0ebc0ccd395a5ed5f.zip
added method round to RichFloat/RichDouble;
fixed bug 1008
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) =>