Following code works fine with Scala 2 but fails with Scala 3:
case class C(protected val id: Int)
Surface.of[C]
The error is:
value id cannot be accessed as a member of (x : Main.C) from module class Main$.
Access to protected value id not permitted because enclosing object Main
is not a subclass of class C in object Main where target is defined
Note: the same works fine with private val.
Following code works fine with Scala 2 but fails with Scala 3:
The error is:
Note: the same works fine with
private val.