Skip to content

Unused import falsely reported when used in named argument #18313

Closed
@2m

Description

@2m

Compiler version

3.3.0 and 3.3.1-RC4

Minimized code

//> using scala "3.3.1-RC4"
//> using options "-Wunused:all"

import scala.deriving.Mirror

case class Test(i: Int, d: Double)
case class Decoder(d: Product => Test)

// OK, no warning returned
// val d = Decoder(summon[Mirror.Of[Test]].fromProduct)

// returns warning:
// [warn] unused import
// [warn] import scala.deriving.Mirror
val d = Decoder(d = summon[Mirror.Of[Test]].fromProduct)

Output

-- Warning: i18313.scala:4:22 -----------------------------------
4 |import scala.deriving.Mirror
  |                      ^^^^^^
  |                      unused import

Expected

No warnings

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions