Skip to content

REPL reports unused import #18383

Closed
Closed
@som-snytt

Description

@som-snytt

Compiler version

3.3.0

Minimized code

  dotty git:(test/repl-unused) ./bin/scala -Wunused:all
Welcome to Scala 3.4.0-RC1-bin-SNAPSHOT-git-c90ad6b (20.0.1, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> import collection.*
1 warning found
-- Warning: ------------------------------------------------------------------------------------------------------------
1 |import collection.*
  |                  ^
  |                  unused import

scala>

Expectation

It's obvious that in REPL, the compiler should not warn on "bare import". (Maybe it's sufficient for compiler not to warn in a compilation unit consisting only of imports.)

It would be nice if REPL never warned on spurious synthetic imports. Not sure if Scala 3 already fixed that issue.

Many build.sbt have cruft to disable warnings in console as a workaround.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions