Skip to content

-Wunused:all causes a compilation error #16650

Closed
@tgodzik

Description

@tgodzik

Compiler version

Started probably with 3.3.0-RC1-bin-20230109-f56089b-NIGHTLY and related to #16157

Minimized code

I think it's more about the classpath than it is about a specific code.

//> using lib "org.scala-lang::scala3-compiler:3.3.0-RC1-bin-20230109-f56089b-NIGHTLY"
//> using scala "3.3.0-RC1-bin-20230109-f56089b-NIGHTLY"
//> using option "-Wunused:all"

import dotty.tools.dotc.util.LinearSet

@main
def run = 
  val a = 123
  println("Hello!")

Output

In the example:

Error compiling project (Scala 3.3.0-RC1-bin-20230109-f56089b-NIGHTLY, JVM)
Error: Unexpected error when compiling project_217a6bd2b4: 'Toplevel definition <init> is defined in
  /home/tgodzik/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.3.0-RC1-bin-20230109-f56089b-NIGHTLY/scala3-compiler_3-3.3.0-RC1-bin-20230109-f56089b-NIGHTLY.jar(dotty/tools/dotc/util/LinearSet$package.class)
and also in
  /home/tgodzik/.cache/coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/3.3.0-RC1-bin-20230109-f56089b-NIGHTLY/scala3-compiler_3-3.3.0-RC1-bin-20230109-f56089b-NIGHTLY.jar(dotty/tools/dotc/util/LinearMap$package.class)
One of these files should be removed from the classpath.'
Compilation failed

Expectation

Compilation passes and shows unused warnings for a and LineraSet

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions