Skip to content

Wunused: fix import false positive in constructors #19283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

szymon-rd
Copy link
Contributor

Fix #19252

In theory, it adds a new false negative instead, but the tree after typer contains the def of val from constructor, so the false pos would be present regardless:

package <empty> {
  package foo {
    trait D1() extends Object {}
  }
  final lazy module val Bug: Bug = new Bug()
  final module class Bug() extends Object() { this: Bug.type =>
    import foo.D1
    class Cl(d1: foo.D1) extends Object() {
      private[this] val d1: foo.D1
      import foo.*
    }
  }
}

@szymon-rd szymon-rd force-pushed the wunused-fix-false-pos-in-constr branch from 799ffb1 to 78bb92c Compare December 17, 2023 20:41
@som-snytt
Copy link
Contributor

Superseded, PR at ticket.

@som-snytt som-snytt closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive unused import
2 participants