Skip to content

Warning about open classes doesn't work in Scala 3.1.0 #13946

Closed
@trackiss

Description

@trackiss

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugregressionThis worked in a previous version but doesn't anymore

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions