Skip to content

Incorrect "never used" for trait referenced by classOf #9058

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
scabug opened this issue Dec 22, 2014 · 2 comments
Closed

Incorrect "never used" for trait referenced by classOf #9058

scabug opened this issue Dec 22, 2014 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 22, 2014

In the example:

package test
object Test {
  def main(args: Array[String]): Unit = {
    println(classOf[IsInFactUsed])
  }

  private trait IsInFactUsed
}

Compiling with -Ywarn-unused gives an incorrect warning

$ scalac -Ywarn-unused test.scala 
test.scala:8: warning: private trait IsInFactUsed in object Test is never used
  private trait IsInFactUsed
                ^
one warning found
@scabug
Copy link
Author

scabug commented Dec 22, 2014

Imported From: https://issues.scala-lang.org/browse/SI-9058?orig=1
Reporter: Emiliano Clariá (eclaria)
Affected Versions: 2.11.4

@retronym retronym added the lint label Apr 24, 2017
@hrhino hrhino changed the title Incorrect "never used" for trait refereced by classOf Incorrect "never used" for trait referenced by classOf Dec 9, 2017
@SethTisue SethTisue added this to the 2.12.5 milestone Feb 16, 2018
@lrytz
Copy link
Member

lrytz commented Feb 22, 2018

scala/scala#6190

@lrytz lrytz closed this as completed Feb 22, 2018
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

5 participants