Skip to content

Missing deprecation message #23794

@som-snytt

Description

@som-snytt

Compiler version

3.7.2

Minimized code

//> using scala "3.7.2"
//> using dep "org.scala-lang::scala3-compiler:3.7.2"

import dotty.tools.dotc.plugins.{PluginPhase, StandardPlugin}
import dotty.tools.dotc.typer.TyperPhase

class MyPluginPhase extends PluginPhase:
  val phaseName: String = "MyPluginPhase"
  override val runsAfter = Set(TyperPhase.name)

class MyPlugin extends StandardPlugin:
  val name: String = "MyPlugin"
  override val description: String = "MyPlugin"

  override def init(options: List[String]): List[PluginPhase] = new MyPluginPhase :: Nil

Output

scala-cli compile --server=false -deprecation test-plugin.scala
-- Deprecation Warning: /home/amarki/snips/test-plugin.scala:15:15 -------------
15 |  override def init(options: List[String]): List[PluginPhase] = new MyPluginPhase :: Nil
   |               ^
   |overriding method init in trait StandardPlugin of type (options: List[String]): List[dotty.tools.dotc.plugins.PluginPhase] is deprecated;
   |  method init of type (options: List[String]): List[dotty.tools.dotc.plugins.PluginPhase] should be removed or renamed.
1 warning found

Expectation

  @deprecatedOverriding("Method 'init' does not allow to access 'Context', use 'initialize' instead.", since = "Scala 3.5.0")
  @deprecated("Use 'initialize' instead.", since = "Scala 3.5.0")
  def init(options: List[String]): List[PluginPhase] = Nil

Same result using actual command line compiler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    itype:bugstat:needs triageEvery issue needs to have an "area" and "itype" label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions