Skip to content

@annotation.nowarn ignored/lost during inlining #22672

Closed
@MartinHH

Description

@MartinHH

Compiler version

3.6.3, 3.3.5 (and many others)

Minimized code

A minimal library (use scala publish local <first_filename> to publish it locally):

//> using scala "3.6.3"

//> using option "-Xfatal-warnings"

//> using publish.organization "io.bar.foo"
//> using publish.name "deprecation-bug-example"
//> using publish.version "0.0.1"

package io.bar.foo.example

@annotation.nowarn("cat=deprecation")
inline def dooFoo: String =
  val stream = Stream.empty
  stream.toString

Then a usage of that library:

//> using scala "3.6.3"

//> using dep "io.bar.foo::deprecation-bug-example::0.0.1"

val x = io.bar.foo.example.dooFoo

Use scala compile <second_filename> to compile it

Output

Compiling project (Scala 3.6.3, JVM (23))
Warning: there was 1 deprecation warning; re-run with -deprecation for details
Compiled project (Scala 3.6.3, JVM (23))

Expectation

No deprecation warning is emitted (as it is the case if dooFoo is not declared inline).

Metadata

Metadata

Assignees

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