Skip to content

-Wconf and @nowarn do not support origin filter #17538

Closed
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.3.0-RC4

Minimized code

import scala.collection.Map
import scala.annotation.nowarn

trait MyMap[K, +V] extends Map[K, V] {
  @nowarn("""cat=deprecation&origin=scala\.collection\.Iterable\.stringPrefix""")
  override protected[this] def stringPrefix: String = "MyMap"
}

Output

-- Warning: t/Test.scala:5:10 --------------------------------------------------
5 |  @nowarn("""cat=deprecation&origin=scala\.collection\.Iterable\.stringPrefix""")
  |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |          Invalid message filter
  |          unknown filter: origin
-- Deprecation Warning: t/Test.scala:6:31 --------------------------------------
6 |  override protected[this] def stringPrefix: String = "MyMap"
  |                               ^
  |overriding method stringPrefix in trait Iterable of type => String is deprecated;
  |  method stringPrefix of type => String should be removed or renamed.```

Expectation

Should compile without waninings

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions