summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-02-01 17:38:56 -0800
committerPaul Phillips <paulp@improving.org>2013-02-01 17:38:56 -0800
commita45a78a1d4111709acdc0bca9a1ac869a8e53ea5 (patch)
tree5c909c41db2470c460cbb3c33672294c9342b914 /test/files/pos
parent26de4394b19d6614b7d414b33f66ebf7adcb8833 (diff)
parent644eb7078a11613a06dcaaefb807cbcc44f65ea7 (diff)
downloadscala-a45a78a1d4111709acdc0bca9a1ac869a8e53ea5.tar.gz
scala-a45a78a1d4111709acdc0bca9a1ac869a8e53ea5.tar.bz2
scala-a45a78a1d4111709acdc0bca9a1ac869a8e53ea5.zip
Merge commit '644eb7078a' into wip/fresh-merge2
Conflicts: build.xml src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t1336.scala10
-rw-r--r--test/files/pos/t5589.scala22
-rw-r--r--test/files/pos/t7035.scala15
3 files changed, 15 insertions, 32 deletions
diff --git a/test/files/pos/t1336.scala b/test/files/pos/t1336.scala
deleted file mode 100644
index 63967985c7..0000000000
--- a/test/files/pos/t1336.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-object Foo {
- def foreach( f : ((Int,Int)) => Unit ) {
- println("foreach")
- f(1,2)
- }
-
- for( (a,b) <- this ) {
- println((a,b))
- }
-}
diff --git a/test/files/pos/t5589.scala b/test/files/pos/t5589.scala
deleted file mode 100644
index 69cbb20391..0000000000
--- a/test/files/pos/t5589.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-class A {
- // First three compile.
- def f1(x: Either[Int, String]) = x.right map (y => y)
- def f2(x: Either[Int, String]) = for (y <- x.right) yield y
- def f3(x: Either[Int, (String, Int)]) = x.right map { case (y1, y2) => (y1, y2) }
- // Last one fails.
- def f4(x: Either[Int, (String, Int)]) = for ((y1, y2) <- x.right) yield ((y1, y2))
-/**
-./a.scala:5: error: constructor cannot be instantiated to expected type;
- found : (T1, T2)
- required: Either[Nothing,(String, Int)]
- def f4(x: Either[Int, (String, Int)]) = for ((y1, y2) <- x.right) yield ((y1, y2))
- ^
-./a.scala:5: error: not found: value y1
- def f4(x: Either[Int, (String, Int)]) = for ((y1, y2) <- x.right) yield ((y1, y2))
- ^
-./a.scala:5: error: not found: value y2
- def f4(x: Either[Int, (String, Int)]) = for ((y1, y2) <- x.right) yield ((y1, y2))
- ^
-three errors found
-**/
-}
diff --git a/test/files/pos/t7035.scala b/test/files/pos/t7035.scala
new file mode 100644
index 0000000000..f45bd0a878
--- /dev/null
+++ b/test/files/pos/t7035.scala
@@ -0,0 +1,15 @@
+case class Y(final var x: Int, final private var y: String, final val z1: Boolean, final private val z2: Any) {
+
+ import Test.{y => someY}
+ List(someY.x: Int, someY.y: String, someY.z1: Boolean, someY.z2: Any)
+ someY.y = ""
+}
+
+object Test {
+ val y = Y(0, "", true, new {})
+ val unapp: Option[(Int, String, Boolean, Any)] = // was (Int, Boolean, String, Any) !!
+ Y.unapply(y)
+
+ val Y(a, b, c, d) = y
+ List(a: Int, b: String, c: Boolean, d: Any)
+}