Closed
Description
Compiler version
3.1.0
Minimized code
// in Printer.scala
class Printer:
def print(s: String): Unit = println(s)
// in BadPrinter.scala
class BadPrinter extends Printer:
override def print(s: String): Unit = println("Bad!!!")
and enabled -source future
flag.
Of course, -language.adHocExtensions
flag has been disabled, and it hasn't imported scala.language.adHocExtensions
in these source files.
Output
It compiles successfully and no warning is output.
Expectation
The warning should be output because the open
modifier hasn't been added.
On the other hand, the warning is output successfully in Scala 3.0.2.