Skip to content

Error messages should include deprecation status of symbol #12730

@som-snytt

Description

@som-snytt

Reproduction steps

Scala version: every version

scala> 42.formatted("%d")
          ^
       warning: method formatted in class StringFormat is deprecated (since 2.12.16): Use `formatString.format(value)` instead of `value.formatted(formatString)`,
       or use the `f""` string interpolator. In Java 15 and later, `formatted` resolves to the new method in String which has reversed parameters.
val res0: String = 42

scala> 42.formatted()
                   ^
       error: not enough arguments for method formatted: (fmtstr: String): String.
       Unspecified value parameter fmtstr.

Problem

Although the general rule is to show errors first and then warnings, on the assumption that errors cascade in spurious warnings, even though warnings may reveal what leads to the error, the descriptive text for a symbol in an error message should include whether it is deprecated.

Possibly it is required only when -deprecation is enabled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions