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

Reflect symbols for method-local case classes report isJava=true, isCaseClass=false #8639

Closed
scabug opened this issue Jun 1, 2014 · 3 comments
Milestone

Comments

@scabug
Copy link

scabug commented Jun 1, 2014

import scala.reflect.runtime.{universe => ru}

def f() = {
  case class Foo()
  val cls = classOf[Foo]
  val m = ru.runtimeMirror(cls.getClassLoader)
  val sym = m.classSymbol(cls)
  assert(sym.isCaseClass)
  assert(!sym.isJava)
}

f()

Either assertion fails.

@scabug
Copy link
Author

scabug commented Jun 1, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8639?orig=1
Reporter: Christopher Currie (codemonkey)
Affected Versions: 2.10.4, 2.11.1

@scabug
Copy link
Author

scabug commented Jun 1, 2014

@retronym said:
Reflection on local classes is sort of a best-effort affair as Scala doesn't pickle the type signatures of these (to keep bytecode size small), so runtime reflection treats them in the same way it treats Java defined classes -- by recovering what it can from Java generic signatures.

@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue
Copy link
Member

working as designed

@SethTisue SethTisue closed this as not planned Won't fix, can't repro, duplicate, stale Mar 18, 2023
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

3 participants