Skip to content

-Wunused false positive on compiletime usage #21805

Open
@som-snytt

Description

@som-snytt

Compiler version

3.5.1

Minimized code

package p:
  val code = "\"hello, world\""

package q:
  import p.*
  import scala.compiletime.testing.*
  def test() = typeCheckErrors("println(code)")

@main def test() = println:
  q.test()

Output

  snips scala run --server=false -Wunused:all testing.scala
-- [E198] Unused Symbol Warning: /home/amarki/snips/testing.scala:6:11 -------------------------------------------------
6 |  import p.*
  |           ^
  |           unused import
1 warning found
List()

Expectation

It would be nice if the lint were aware of compiletime ops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lintingLinting warnings enabled with -W or -Xlintitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions