Skip to content

-Wunused:all and higher kinded type type parameter #16681

Closed as not planned
Closed as not planned
@amumurst

Description

@amumurst

I tried adding the new unused flag (from #16157) to my work codebase and was surprised that it warned about unused import when used with the cats libraries IO type. A minimal reproducer independent of cats is below.

Compiler version

With nightly: 3.3.0-RC1-bin-20230112-be10bc6-NIGHTLY

Minimized code

//> using scala "3.3.0-RC1-bin-20230112-be10bc6-NIGHTLY"
//> using option "-Wunused:all"

object myPackage:
   case class HKT[A](a: A)

trait Thing[F[_]]
import myPackage.HKT
val x = new Thing[HKT]{}

Output

[warn] ./unused-higher-order-type-param.sc:8:18: unused import
[warn] import myPackage.HKT
[warn]                  ^^^

Expectation

HKT is used as the instance of F in Thing, and hence should not be reported as unused.

Metadata

Metadata

Assignees

Labels

area:reportingError reporting including formatting, implicit suggestions, etcitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions