diff options
author | Paul Phillips <paulp@improving.org> | 2012-04-28 12:37:12 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-04-28 13:57:20 -0700 |
commit | 3404d5a9bf750e7022934d6b70035718544be900 (patch) | |
tree | 067fed298aa344177f0db807eb43c2c8ad36f04e /src/library/scala/Function3.scala | |
parent | 14144be0bcd3f6823a9622c6f962aed295ef3392 (diff) | |
download | scala-3404d5a9bf750e7022934d6b70035718544be900.tar.gz scala-3404d5a9bf750e7022934d6b70035718544be900.tar.bz2 scala-3404d5a9bf750e7022934d6b70035718544be900.zip |
@unspecialized annotation.
Suppresses specialization on a per-method basis.
I would have preferred to call it @nospecialize, but seeing as the
positive form of the annotation is @specialized, that would have sown
unnecessary grammatical confusion. @nospecialized sounds a bit too
caveman for my tastes. "Grog no specialized! Grog generic!"
Diffstat (limited to 'src/library/scala/Function3.scala')
-rw-r--r-- | src/library/scala/Function3.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scala/Function3.scala b/src/library/scala/Function3.scala index 62a997c1b5..bbbde82056 100644 --- a/src/library/scala/Function3.scala +++ b/src/library/scala/Function3.scala @@ -21,16 +21,17 @@ trait Function3[-T1, -T2, -T3, +R] extends AnyRef { self => /** Creates a curried version of this function. * * @return a function `f` such that `f(x1)(x2)(x3) == apply(x1, x2, x3)` - */ def curried: T1 => T2 => T3 => R = { + */ + @annotation.unspecialized def curried: T1 => T2 => T3 => R = { (x1: T1) => (x2: T2) => (x3: T3) => apply(x1, x2, x3) } - /** Creates a tupled version of this function: instead of 3 arguments, * it accepts a single [[scala.Tuple3]] argument. * * @return a function `f` such that `f((x1, x2, x3)) == f(Tuple3(x1, x2, x3)) == apply(x1, x2, x3)` */ - def tupled: Tuple3[T1, T2, T3] => R = { + + @annotation.unspecialized def tupled: Tuple3[T1, T2, T3] => R = { case Tuple3(x1, x2, x3) => apply(x1, x2, x3) } override def toString() = "<function3>" |