diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-11-22 03:12:36 -0800 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-11-22 03:12:36 -0800 |
commit | 666f39d3493ee633a616c40f1c41add1190a3a40 (patch) | |
tree | a62015e39bfdd6235bdcf0bef31fc31342ea60b6 /test/files/pos | |
parent | 42657a6918ef7d6fd3f36838739ec8a3b64744a3 (diff) | |
parent | b004c3ddb38f8e690a0895a51ad0c83ff57a01e7 (diff) | |
download | scala-666f39d3493ee633a616c40f1c41add1190a3a40.tar.gz scala-666f39d3493ee633a616c40f1c41add1190a3a40.tar.bz2 scala-666f39d3493ee633a616c40f1c41add1190a3a40.zip |
Merge pull request #3131 from densh/pr/deprecate-pair-and-triple
Deprecate Pair and Triple
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/bounds.scala | 6 | ||||
-rw-r--r-- | test/files/pos/patmat.scala | 4 | ||||
-rw-r--r-- | test/files/pos/spec-doubledef-new.scala | 6 | ||||
-rw-r--r-- | test/files/pos/spec-doubledef-old.scala | 6 | ||||
-rw-r--r-- | test/files/pos/t0064.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t247.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t443.scala | 8 | ||||
-rw-r--r-- | test/files/pos/t4579.scala | 12 | ||||
-rw-r--r-- | test/files/pos/t5120.scala | 4 | ||||
-rw-r--r-- | test/files/pos/tcpoly_bounds1.scala | 4 | ||||
-rw-r--r-- | test/files/pos/typealiases.scala | 2 | ||||
-rw-r--r-- | test/files/pos/unapplyNeedsMemberType.scala | 2 | ||||
-rw-r--r-- | test/files/pos/valdefs.scala | 2 |
13 files changed, 31 insertions, 31 deletions
diff --git a/test/files/pos/bounds.scala b/test/files/pos/bounds.scala index cfea4626c3..26bc84a1b9 100644 --- a/test/files/pos/bounds.scala +++ b/test/files/pos/bounds.scala @@ -1,11 +1,11 @@ trait Map[A, +C] { - def ++ [B1 >: C] (kvs: Iterable[Pair[A, B1]]): Map[A, B1] = this - def ++ [B1 >: C] (kvs: Iterator[Pair[A, B1]]): Map[A, B1] = this + def ++ [B1 >: C] (kvs: Iterable[Tuple2[A, B1]]): Map[A, B1] = this + def ++ [B1 >: C] (kvs: Iterator[Tuple2[A, B1]]): Map[A, B1] = this } class ListMap[A, +B] extends Map[A, B] {} object ListMap { def empty[X, Y] = new ListMap[X, Y] - def apply[A1, B2](elems: Pair[A1, B2]*): Map[A1, B2] = empty[A1,B2].++(elems.iterator) + def apply[A1, B2](elems: Tuple2[A1, B2]*): Map[A1, B2] = empty[A1,B2].++(elems.iterator) } diff --git a/test/files/pos/patmat.scala b/test/files/pos/patmat.scala index 4e652b146e..51b879abf2 100644 --- a/test/files/pos/patmat.scala +++ b/test/files/pos/patmat.scala @@ -3,8 +3,8 @@ object ZipFun { //just compilation - def zipFun[a, b](xs: List[a], ys: List[b]): List[Pair[a, b]] = (Pair(xs, ys): @unchecked) match { - // !!! case Pair(List(), _), Pair(_, List()) => List() + def zipFun[a, b](xs: List[a], ys: List[b]): List[Tuple2[a, b]] = ((xs, ys): @unchecked) match { + // !!! case (List(), _), (_, List()) => List() case (x :: xs1, y :: ys1) => (x, y) :: zipFun(xs1, ys1) } } diff --git a/test/files/pos/spec-doubledef-new.scala b/test/files/pos/spec-doubledef-new.scala index ad9c6399a5..589ceb33b2 100644 --- a/test/files/pos/spec-doubledef-new.scala +++ b/test/files/pos/spec-doubledef-new.scala @@ -19,12 +19,12 @@ abstract class B[T, @specialized(scala.Int) U : TypeTag, @specialized(scala.Int) val u: U val v: V - def f(t: T, v2: V): Pair[U, V] = { + def f(t: T, v2: V): Tuple2[U, V] = { val m: Array[U] = null if (m.isEmpty) { - Pair(u, v) + (u, v) } else { - Pair(u, v2) + (u, v2) } } }
\ No newline at end of file diff --git a/test/files/pos/spec-doubledef-old.scala b/test/files/pos/spec-doubledef-old.scala index 86b0d857d3..bde259e4fa 100644 --- a/test/files/pos/spec-doubledef-old.scala +++ b/test/files/pos/spec-doubledef-old.scala @@ -17,12 +17,12 @@ abstract class B[T, @specialized(scala.Int) U : Manifest, @specialized(scala.Int val u: U val v: V - def f(t: T, v2: V): Pair[U, V] = { + def f(t: T, v2: V): Tuple2[U, V] = { val m: Array[U] = null if (m.isEmpty) { - Pair(u, v) + (u, v) } else { - Pair(u, v2) + (u, v2) } } } diff --git a/test/files/pos/t0064.scala b/test/files/pos/t0064.scala index c2ce4bf6d0..1eeca8dcad 100644 --- a/test/files/pos/t0064.scala +++ b/test/files/pos/t0064.scala @@ -1,6 +1,6 @@ object B { def main(Args:Array[String]) = { - val Pair(_,x) = Pair(1,2); + val (_,x) = (1,2); x + 1; } } diff --git a/test/files/pos/t247.scala b/test/files/pos/t247.scala index e976404e61..fdcafeb2c6 100644 --- a/test/files/pos/t247.scala +++ b/test/files/pos/t247.scala @@ -16,11 +16,11 @@ class Tree[KEY,Entry](order:Order[KEY]) { def size =0; } -class TreeMap[KEY,VALUE](_factory:TreeMapFactory[KEY]) extends Tree[KEY,Pair[KEY,VALUE]](_factory.order) with scala.collection.DefaultMap[KEY, VALUE] with Map[KEY, VALUE] { +class TreeMap[KEY,VALUE](_factory:TreeMapFactory[KEY]) extends Tree[KEY,Tuple2[KEY,VALUE]](_factory.order) with scala.collection.DefaultMap[KEY, VALUE] with Map[KEY, VALUE] { val factory = _factory val order = _factory.order; def this(newOrder:Order[KEY]) = this(new TreeMapFactory[KEY](newOrder)); def get(key:KEY) = null; - def iterator:Iterator[Pair[KEY,VALUE]] = null; + def iterator:Iterator[Tuple2[KEY,VALUE]] = null; override def size = super[Tree].size } diff --git a/test/files/pos/t443.scala b/test/files/pos/t443.scala index 5b5e3ea828..cdaefe9ecd 100644 --- a/test/files/pos/t443.scala +++ b/test/files/pos/t443.scala @@ -1,10 +1,10 @@ object Test { - def lookup(): Option[Pair[String, String]] = - ((null: Option[Pair[String, String]]) : @unchecked) match { - case Some(Pair(_, _)) => + def lookup(): Option[Tuple2[String, String]] = + ((null: Option[Tuple2[String, String]]) : @unchecked) match { + case Some((_, _)) => if (true) - Some(Pair(null, null)) + Some((null, null)) else lookup() match { case Some(_) => Some(null) diff --git a/test/files/pos/t4579.scala b/test/files/pos/t4579.scala index 8951ec011f..cd1553f02a 100644 --- a/test/files/pos/t4579.scala +++ b/test/files/pos/t4579.scala @@ -190,10 +190,10 @@ object LispCaseClasses extends Lisp { def extendEnv(env: Environment, ps: List[String], args: List[Data]): Environment = - Pair(ps, args) match { - case Pair(List(), List()) => + (ps, args) match { + case (List(), List()) => env - case Pair(p :: ps1, arg :: args1) => + case (p :: ps1, arg :: args1) => extendEnv(env.extend(p, arg), ps1, args1) case _ => lispError("wrong number of arguments") @@ -381,10 +381,10 @@ object LispAny extends Lisp { def extendEnv(env: Environment, ps: List[String], args: List[Data]): Environment = - Pair(ps, args) match { - case Pair(List(), List()) => + (ps, args) match { + case (List(), List()) => env - case Pair(p :: ps1, arg :: args1) => + case (p :: ps1, arg :: args1) => extendEnv(env.extend(p, arg), ps1, args1) case _ => lispError("wrong number of arguments") diff --git a/test/files/pos/t5120.scala b/test/files/pos/t5120.scala index 6731af14e4..86d4470bd5 100644 --- a/test/files/pos/t5120.scala +++ b/test/files/pos/t5120.scala @@ -5,9 +5,9 @@ class Test { class ScopedKey[T] class Value[T] - class Compiled[T](val settings: Seq[Pair[T]]) + class Compiled[T](val settings: Seq[Tuple2[T]]) - case class Pair[T](k: ScopedKey[T], v: ScopedKey[T]) + case class Tuple2[T](k: ScopedKey[T], v: ScopedKey[T]) def transform[T](x: T) = x diff --git a/test/files/pos/tcpoly_bounds1.scala b/test/files/pos/tcpoly_bounds1.scala index 5874cc664d..63263cb152 100644 --- a/test/files/pos/tcpoly_bounds1.scala +++ b/test/files/pos/tcpoly_bounds1.scala @@ -1,7 +1,7 @@ -class Foo[t[x]<: Pair[Int, x]] +class Foo[t[x]<: Tuple2[Int, x]] // -class MyPair[z](a: Int, b: z) extends Pair[Int, z](a,b) +class MyPair[z](a: Int, b: z) extends Tuple2[Int, z](a,b) object foo extends Foo[MyPair] diff --git a/test/files/pos/typealiases.scala b/test/files/pos/typealiases.scala index d03b521f77..93d1dce4dc 100644 --- a/test/files/pos/typealiases.scala +++ b/test/files/pos/typealiases.scala @@ -14,7 +14,7 @@ trait Test[T] { object main extends Test[Int] { val pair1 = (1,1) - implicit def topair(x: Int): Pair[Int, Int] = (x,x) + implicit def topair(x: Int): Tuple2[Int, Int] = (x,x) val pair2: MyPair[Int] = 1 val x: Short = 1 } diff --git a/test/files/pos/unapplyNeedsMemberType.scala b/test/files/pos/unapplyNeedsMemberType.scala index b423257e04..3a96e189af 100644 --- a/test/files/pos/unapplyNeedsMemberType.scala +++ b/test/files/pos/unapplyNeedsMemberType.scala @@ -19,7 +19,7 @@ class Join[a] extends Gunk[a] { def append(s1: Seq, s2: Seq): Seq = s1 // mock implementation def unapply_Cons(s: Any) = s match { - case App(Cons(x, xs), ys) => Some(Pair(x, append(xs, ys))) + case App(Cons(x, xs), ys) => Some((x, append(xs, ys))) case _ => null } } diff --git a/test/files/pos/valdefs.scala b/test/files/pos/valdefs.scala index 85ffa132b7..c8f78cd2bf 100644 --- a/test/files/pos/valdefs.scala +++ b/test/files/pos/valdefs.scala @@ -11,6 +11,6 @@ object test { } abstract class Sub2() extends Base() { - override val Pair(x, y) = Pair("abc", 2.0); + override val (x, y) = ("abc", 2.0); } } |