Skip to content

Missing deprecation in named arg of annotation #13193

Description

@som-snytt

Questions are not bug reports

Except at whatsthatbug.com, where reporting a bug implies asking which bug it is.

Reproduction steps

Scala version: 2.13.18

Welcome to Scala 2.13.18 (OpenJDK 64-Bit Server VM, Java 25.0.2).
Type in expressions for evaluation. Or try :help.

scala> def j(@deprecatedName(name = Symbol("x"), since="forever") a: Int): Int = a
                                                                  ^
       warning: constructor deprecatedName in class deprecatedName is deprecated (since 2.13.0): The parameter name should be a String, not a symbol.
def j(a: Int): Int

scala> def j(@deprecatedName(since = "forever", name = Symbol("x")) a: Int): Int = a
def j(a: Int): Int

scala>

Problem

Swapping args should not suppress the warning.

Noticed at scala/scala3#27048

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions