Skip to content

3.3.0-RC5 -Wunused:imports false positive for imports that "shadow" other imports #17371

Closed
@Lasering

Description

@Lasering

Compiler version

3.3.0-RC5 with -Wunused:imports flag on.

Minimized code

trait Circular[T] extends Ordering[T]
trait Turns[C: Circular, T] extends Ordering[T]:
  extension (turns: T)
    def extract: C

def foo[K, T](start: T, end: T)(using circular: Circular[K], turns: Turns[K, T]): Boolean =
  import turns.given
  if start > end then throw new IllegalArgumentException("start must be <= end")
  
  import circular.given
  start.extract < end.extract

Output

 10 |    import turns.given
    |                 ^^^^^
    |                 unused import

Expectation

No warning should be emitted.

Metadata

Metadata

Assignees

No one assigned

    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