Skip to content

Deprecation warning generated via macro points to nonsense position #22795

Closed
@jchyb

Description

@jchyb

Compiler version

any

Minimized code

Run with -deprecation

import scala.quoted._

@deprecated object A
object Test {
  inline def test() = ${testImpl}
  def testImpl(using Quotes): Expr[Any] =
    import quotes.reflect._
    Ref(Symbol.classSymbol("A$").companionModule).asExpr
}
@main def main() =
  Test.test()

Output

-- Deprecation Warning: depr2.scala:4:46 ---------------------------------------
4 |
  |                                              ^^^^^^^^^^^
  |                                              object A is deprecated

Expectation

Point the warning to the callsite., message could also probably be improved

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions