Skip to content

Deprecated case class element warns (twice!) at its definition #17908

Closed
@som-snytt

Description

@som-snytt

Compiler version

Welcome to Scala 3.3.2-RC1-bin-SNAPSHOT-git-348729e (20.0.1, Java OpenJDK 64-Bit Server VM).

Minimized code

Welcome to Scala 3.3.2-RC1-bin-SNAPSHOT-git-348729e (20.0.1, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> @deprecated("now","0.1") case class K(k: Int)
// defined case class K

scala> case class K(@deprecated("now","0.1") k: Int)
2 warnings found
-- Deprecation Warning: ------------------------------------------------------------------------------------------------
1 |case class K(@deprecated("now","0.1") k: Int)
  |           ^
  |           value k in class K is deprecated since 0.1: now
-- Deprecation Warning: ------------------------------------------------------------------------------------------------
1 |case class K(@deprecated("now","0.1") k: Int)
  |                                            ^
  |                                            value k in class K is deprecated since 0.1: now
// defined case class K

scala>

Expectation

No deprecation at definition.

Follow-up to #11022.

Noticed at https://github.com/scalapb/ScalaPB/blob/master/scalapb-runtime/src/main/js-native/com/google/protobuf/descriptor/FileOptions.scala#L94

I wonder if this issue is in time for the Scala Days spree!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions