diff --git a/tests/run/i4528.scala b/tests/run/i4528.scala new file mode 100644 index 000000000000..8efcf121b085 --- /dev/null +++ b/tests/run/i4528.scala @@ -0,0 +1,9 @@ +import scala.reflect.Selectable.reflectiveSelectable + +type T = {val a: Int; def a_=(x: Int): Unit} + +@main def Test() = + val x: T = (new { var a = 10 }).asInstanceOf[T] + assert(x.a == 10) + x.a = 11 + assert(x.a == 11)