Details

Type: Bug

Status: Closed

Priority: Major

Resolution: Fixed

Affects Version/s: Scala 2.9.2, Scala 2.10.0

Fix Version/s: Scala 2.10.1

Component/s: Misc Compiler

Labels:None
Description
Variation of https://issues.scalalang.org/browse/SI5661:
$ ./qbin/scala Welcome to Scala version 2.10.020120925012651d6a933c4f5 (Java HotSpot(TM) 64Bit Server VM, Java 1.6.0_35). Type in expressions to have them evaluated. Type :help for more information. scala> def f(x: => Int): Int = x f: (x: => Int)Int scala> f _ res0: => Int => Int = <function1>
Note: d6a933c4f5 is a local commit on top of ffaa3cb89edc1407c99c89f36248358c16887fe7 from 2.10.x, but it's just a small change:
 a/src/library/scala/package.scala +++ b/src/library/scala/package.scala @@ 95,7 +95,10 @@ package object scala { val Equiv = scala.math.Equiv type Fractional[T] = scala.math.Fractional[T] + val Fractional = scala.math.Fractional + type Integral[T] = scala.math.Integral[T] + val Integral = scala.math.Integral type Numeric[T] = scala.math.Numeric[T] val Numeric = scala.math.Numeric
while the () is useful, I don't think this is actually a bug, more an improvement. IIRC, => A => B => C is a valid function type.