summaryrefslogtreecommitdiff
path: root/test/files/run/t5608.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-05-03 11:30:33 -0700
committerPaul Phillips <paulp@improving.org>2012-05-03 11:45:21 -0700
commit453d615fb3c6d0db3a0a43c9232bc12584e39107 (patch)
tree2698a7a2c09c47b3a0f25722fa47f90ef49641bc /test/files/run/t5608.scala
parent03e3a40951ec7d1612cb668973f4d2e5e01872e9 (diff)
downloadscala-453d615fb3c6d0db3a0a43c9232bc12584e39107.tar.gz
scala-453d615fb3c6d0db3a0a43c9232bc12584e39107.tar.bz2
scala-453d615fb3c6d0db3a0a43c9232bc12584e39107.zip
Fix for SI-5608, crasher with value classes.
Anyone who doubts the importance of avoiding duplication is invited to look closely at the cause of this bug as revealed in this one line patch.
Diffstat (limited to 'test/files/run/t5608.scala')
-rw-r--r--test/files/run/t5608.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t5608.scala b/test/files/run/t5608.scala
new file mode 100644
index 0000000000..19b3681932
--- /dev/null
+++ b/test/files/run/t5608.scala
@@ -0,0 +1,12 @@
+object Test {
+ def main(args:Array[String]) {
+ val ns = Array(3L, 3L, 3L)
+ val a1: A = new A(ns(0))
+ val a2: A = new A(ns(0))
+ println(a1 + a2)
+ }
+}
+
+class A(val u: Long) extends AnyVal {
+ def +(other: A) = new A(other.u + u)
+}