From 9008baf51a59e448ac893006e2a376f7d579e791 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 4 Dec 2025 12:41:19 +0100 Subject: [PATCH] chore: add regression test for #4528 --- tests/run/i4528.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/run/i4528.scala 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)