Skip to content
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

false positive "unused import" warning #9945

Closed
scabug opened this issue Oct 1, 2016 · 5 comments
Closed

false positive "unused import" warning #9945

scabug opened this issue Oct 1, 2016 · 5 comments

Comments

@scabug
Copy link

scabug commented Oct 1, 2016

A.scala

object A

Row.java

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

@Retention(RetentionPolicy.RUNTIME)
public @interface Row {
  String value() default "";
}

build.sbt

scalacOptions += "-Ywarn-unused-import"

scalaVersion := "2.12.0-RC1"

execute "sbt doc"

[warn] java-unused-warning/Row.java:1: Unused import
[warn] import java.lang.annotation.Retention;
[warn]                              ^
[warn] java-unused-warning/Row.java:2: Unused import
[warn] import java.lang.annotation.RetentionPolicy;
[warn]                              ^
@scabug
Copy link
Author

scabug commented Oct 1, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9945?orig=1
Reporter: kenji yoshida
Affected Versions: 2.12.0-RC1, 2.12.0-RC2
See #9923

@scabug
Copy link
Author

scabug commented Nov 7, 2016

@SethTisue said:
is this a duplicate of SI-9923?

@scabug
Copy link
Author

scabug commented Nov 8, 2016

@som-snytt said:
I would guess not a duplicate.

@scabug
Copy link
Author

scabug commented Nov 16, 2016

@SethTisue said (edited on Nov 16, 2016 7:33:42 PM UTC):
It seems peculiar that -Ywarn-unused-import would have any effect on processing of Java sources at all. Seems like javac's job.

@scabug
Copy link
Author

scabug commented Nov 17, 2016

@som-snytt said:
scala/scala#5535

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants