diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-28 20:13:28 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-01-28 21:27:23 +0100 |
commit | 9afae59f0e46bed0acf40d043d3ee2a0e0ef432f (patch) | |
tree | eed2fd8fe79a873f84b3fea95c1e9d005e0b650c /test/files/pos | |
parent | 02963d724c512251ce66502226408091686989ee (diff) | |
download | scala-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/files/pos')
-rw-r--r-- | test/files/pos/t7035.scala | 15 |
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) +} |