Skip to content

3.6.4-RC - false positive unused import #22692

Closed as not planned
Closed as not planned
@OndrejSpanel

Description

@OndrejSpanel

Another report, to save my damaged reputation after #22690 fiasco. 😘

Compiler version

3.6.4-RC1, 3.6.4-RC2

Minimized code

import javax.swing.*
import javax.swing.event as swingEvent

type b = AbstractButton
type t = swingEvent.AncestorListener

Output

C:\Dev\Sandbox\src\main\scala\Main.scala:2:26
unused import
import javax.swing.event as swingEvent

Expectation

The import is not unused, the code does not compile without it.

See also this Scastie: https://scastie.scala-lang.org/OndrejSpanel/bHJcv9AhSS2DODsdcQFvAw/17

Note

Replacing wildcard import on the first line makes the error go away, this compiles fine:

import javax.swing.AbstractButton
import javax.swing.event as swingEvent

type b = AbstractButton
type t = swingEvent.AncestorListener

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lintingLinting warnings enabled with -W or -Xlintitype:bugstat:fixed in nightlyThis issue may be present in the latest stable or RC version of Next, but has been since fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions