-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Neither scalac nor dotc reports Bar::foo as an invalid override of Foo::foo, even though at runtime, it doesn't override anything
class Foo {
def test = foo
protected[this] def foo = 1
}
class Bar extends Foo {
override private[this] def foo = 2
}
object Test {
def main(args: Array[String]): Unit = {
println((new Bar).test) // prints 1
println((new Bar: Foo).test) // prints 1
}
}Not that modifying Bar as follow fixes the issue:
class Bar extends Foo {
- override private[this] def foo = 2
+ override protected[this] def foo = 2
}