summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-09-12 14:49:07 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-09-12 21:48:55 +1000
commita919fd7fa1f3c39dc396e7758240354e6fb0e79b (patch)
treef110734c398a8ed02fcf3446c31bdc108171bf8e /test/files
parent05016d9035ab9b1c866bd9f12fdd0491f1ea0cbb (diff)
downloadscala-a919fd7fa1f3c39dc396e7758240354e6fb0e79b.tar.gz
scala-a919fd7fa1f3c39dc396e7758240354e6fb0e79b.tar.bz2
scala-a919fd7fa1f3c39dc396e7758240354e6fb0e79b.zip
Avoid omitting constant typed vals in constructors
Fix for regression in 2.12.0-RC1 compiling shapeless tests. They were given the same treatment as vals that are members of classes on the definition side without the requisite transformation of references to the val to fold the constant into references. This commit limits the transform to members of classes. Co-Authored-By: Miles Sabin <miles@milessabin.com>
Diffstat (limited to 'test/files')
-rw-r--r--test/files/pos/shapeless-regression.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/shapeless-regression.scala b/test/files/pos/shapeless-regression.scala
new file mode 100644
index 0000000000..f3a1ed1ba0
--- /dev/null
+++ b/test/files/pos/shapeless-regression.scala
@@ -0,0 +1,16 @@
+class W[T <: AnyRef](val t: T) {
+ val v: T {} = t
+}
+
+object W {
+ def apply[T <: AnyRef](t: T) = new W[t.type](t)
+}
+
+object RightAssoc {
+ def ra_:[T](t: T): Unit = ()
+}
+
+object Boom {
+ W("fooo").v ra_: RightAssoc
+}
+