Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wunused false positive on compiletime usage #21805

Open
som-snytt opened this issue Oct 18, 2024 · 0 comments
Open

-Wunused false positive on compiletime usage #21805

som-snytt opened this issue Oct 18, 2024 · 0 comments
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug

Comments

@som-snytt
Copy link
Contributor

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.

@som-snytt som-snytt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:linting Linting warnings enabled with -W or -Xlint and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:linting Linting warnings enabled with -W or -Xlint itype:bug
Projects
None yet
Development

No branches or pull requests

1 participant