Skip to content

Import rewrite should respect -Wconf (rewrite when warning) #24009

@som-snytt

Description

@som-snytt

Compiler version

3.8

Minimized code

//> using scala 3.7.2
//> using options -Wunused:imports -Wconf:origin=scala.compiletime.testing.*:s -rewrite

def test: Unit = {
  import scala.compiletime.testing.typeCheckErrors
  //import scala.compiletime.testing.* // workaround
  //typeChecks("2 + 2")
  typeCheckErrors("2 + 2")
}

Output

Lint incorrectly warns but -Wconf says ignore it. But -rewrite removes the import anyway.

Expectation

Lint should rewrite only what actually warns.

Noticed with some chagrin at #23967 (comment).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions