From a919fd7fa1f3c39dc396e7758240354e6fb0e79b Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 12 Sep 2016 14:49:07 +1000 Subject: 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 --- test/files/pos/shapeless-regression.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/files/pos/shapeless-regression.scala (limited to 'test/files') 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 +} + -- cgit v1.2.3