summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-01-28 20:13:28 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-01-28 21:27:23 +0100
commit9afae59f0e46bed0acf40d043d3ee2a0e0ef432f (patch)
treeeed2fd8fe79a873f84b3fea95c1e9d005e0b650c /test
parent02963d724c512251ce66502226408091686989ee (diff)
downloadscala-9afae59f0e46bed0acf40d043d3ee2a0e0ef432f.tar.gz
scala-9afae59f0e46bed0acf40d043d3ee2a0e0ef432f.tar.bz2
scala-9afae59f0e46bed0acf40d043d3ee2a0e0ef432f.zip
SI-7035 Centralize case field accessor sorting.
It is both burdensome and dangerous to expect callers to reorder these. This was seen in the field permutation in the unapply method; a regression in 2.10.0.
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t7035.scala15
1 files changed, 15 insertions, 0 deletions
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)
+}