Closed
Description
Minimized code
class C extends java.util.LinkedList[String] {
override def size(): Int = super.size()
}
Output
Compile error in 0.25.0-RC2
and 0.26.0-bin-20200719-21a90aa-NIGHTLY
:
[error] -- Error: /Users/thanhbv/tmp/ex/src/main/scala/C.scala:2:15 --------------------
[error] 2 | override def size(): Int = super.size()
[error] | ^
[error] |error overriding variable size in class LinkedList of type Int;
[error] | method size of type (): Int cannot override final member variable size in class LinkedList
Expectation
Compile successfully as in dotty 0.24.0
& in scala 2