I tested the following code of structural type:
trait Data
object Main
{
def main(args: Array[String]): Unit =
{
val data = new Data {
val value: Int = 1
}
println(data.value)
}
}
It compiled successfully in Scala 2.13.2 but failed in Dotty/Scala3. How to use structural types in Dotty/Scala3? Thanks!