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/Tuple2.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/Tuple2.scala')
-rw-r--r-- | src/library/scala/Tuple2.scala | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/library/scala/Tuple2.scala b/src/library/scala/Tuple2.scala index 37ab564c3c..58638f440f 100644 --- a/src/library/scala/Tuple2.scala +++ b/src/library/scala/Tuple2.scala @@ -23,7 +23,7 @@ case class Tuple2[@specialized(Int, Long, Double, Char, Boolean, AnyRef) +T1, @s extends Product2[T1, T2] { override def toString() = "(" + _1 + "," + _2 + ")" - + /** Swaps the elements of this `Tuple`. * @return a new Tuple where the first element is the second element of this Tuple and the * second element is the first element of this Tuple. @@ -31,6 +31,7 @@ case class Tuple2[@specialized(Int, Long, Double, Char, Boolean, AnyRef) +T1, @s def swap: Tuple2[T2,T1] = Tuple2(_2, _1) @deprecated("Use `zipped` instead.", "2.9.0") + @annotation.unspecialized def zip[Repr1, El1, El2, To](implicit w1: T1 => TLike[El1, Repr1], w2: T2 => Iterable[El2], cbf1: CBF[Repr1, (El1, El2), To]): To = { @@ -54,16 +55,6 @@ case class Tuple2[@specialized(Int, Long, Double, Char, Boolean, AnyRef) +T1, @s def zipped[Repr1, El1, Repr2, El2](implicit w1: T1 => TLike[El1, Repr1], w2: T2 => ILike[El2, Repr2]): Zipped[Repr1, El1, Repr2, El2] = new Zipped[Repr1, El1, Repr2, El2](_1, _2) - /** - * @define coll zipped - * @define Coll Zipped - * @define orderDependent - * @define orderDependentFold - * @define mayNotTerminateInf - * @define willNotTerminateInf - * @define collectExample - * @define undefinedorder - */ class Zipped[+Repr1, +El1, +Repr2, +El2](coll1: TLike[El1, Repr1], coll2: ILike[El2, Repr2]) { // coll2: ILike for filter def map[B, To](f: (El1, El2) => B)(implicit cbf: CBF[Repr1, B, To]): To = { val b = cbf(coll1.repr) |