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/Function9.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/Function9.scala')
-rw-r--r-- | src/library/scala/Function9.scala | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/scala/Function9.scala b/src/library/scala/Function9.scala index 0c273ba929..2e35f7949c 100644 --- a/src/library/scala/Function9.scala +++ b/src/library/scala/Function9.scala @@ -21,16 +21,17 @@ trait Function9[-T1, -T2, -T3, -T4, -T5, -T6, -T7, -T8, -T9, +R] extends AnyRef /** Creates a curried version of this function. * * @return a function `f` such that `f(x1)(x2)(x3)(x4)(x5)(x6)(x7)(x8)(x9) == apply(x1, x2, x3, x4, x5, x6, x7, x8, x9)` - */ def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => R = { + */ + @annotation.unspecialized def curried: T1 => T2 => T3 => T4 => T5 => T6 => T7 => T8 => T9 => R = { (x1: T1) => ((x2: T2, x3: T3, x4: T4, x5: T5, x6: T6, x7: T7, x8: T8, x9: T9) => self.apply(x1, x2, x3, x4, x5, x6, x7, x8, x9)).curried } - /** Creates a tupled version of this function: instead of 9 arguments, * it accepts a single [[scala.Tuple9]] argument. * * @return a function `f` such that `f((x1, x2, x3, x4, x5, x6, x7, x8, x9)) == f(Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9)) == apply(x1, x2, x3, x4, x5, x6, x7, x8, x9)` */ - def tupled: Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9] => R = { + + @annotation.unspecialized def tupled: Tuple9[T1, T2, T3, T4, T5, T6, T7, T8, T9] => R = { case Tuple9(x1, x2, x3, x4, x5, x6, x7, x8, x9) => apply(x1, x2, x3, x4, x5, x6, x7, x8, x9) } override def toString() = "<function9>" |