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