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

Reflection: MissingRequirementError for top-level classes with escaped names #7252

Closed
scabug opened this issue Mar 13, 2013 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Mar 13, 2013

The attached example fails in line 10 with a MissingRequirementError while (from what I can tell) creating a TypeTag for an instance of a case class with an escaped name (Strange-Name). Line 9 demonstrates that the error does not show for nested classes. Is this a known limitation?

@scabug
Copy link
Author

scabug commented Mar 13, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7252?orig=1
Reporter: Felix Geller (fgeller)
Affected Versions: 2.10.0
Attachments:

  • Tester.scala (created on Mar 13, 2013 9:49:37 PM UTC, 365 bytes)

@scabug
Copy link
Author

scabug commented Mar 13, 2013

Felix Geller (fgeller) said (edited on Mar 13, 2013 9:56:10 PM UTC):
Sample output on Mac OS X 10.8.2 with

$ scala -version
Scala code runner version 2.10.0 -- Copyright 2002-2012, LAMP/EPFL

$ java -version
openjdk version "1.7.0-u14-b10"
OpenJDK Runtime Environment (build 1.7.0-u14-b10-20130120)
OpenJDK 64-Bit Server VM (build 24.0-b29, mixed mode)

$ scalac Tester.scala && scala Tester
Tester$ObjectContainer@7ad698f7
Tester$ObjectContainer@2237ed25
scala.reflect.internal.MissingRequirementError: class Strange$minusName not found.
	at scala.reflect.internal.MissingRequirementError$.signal(MissingRequirementError.scala:16)
	at scala.reflect.internal.MissingRequirementError$.notFound(MissingRequirementError.scala:17)
	at scala.reflect.internal.Mirrors$RootsBase.ensureClassSymbol(Mirrors.scala:90)
	at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:119)
	at scala.reflect.internal.Mirrors$RootsBase.staticClass(Mirrors.scala:21)
	at Tester$$typecreator3$1.apply(Tester.scala:10)
	at scala.reflect.api.TypeTags$TypeTag$.apply(TypeTags.scala:302)
	at Tester$delayedInit$body.apply(Tester.scala:10)
	at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.App$$anonfun$main$1.apply(App.scala:71)
	at scala.App$$anonfun$main$1.apply(App.scala:71)
	at scala.collection.immutable.List.foreach(List.scala:309)
	at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
	at scala.App$class.main(App.scala:71)
	at Tester$.main(Tester.scala:5)
	at Tester.main(Tester.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:71)
	at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
	at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:139)
	at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:71)
	at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:139)
	at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:28)
	at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:45)
	at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:35)
	at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:45)
	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:96)
	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:105)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

@scabug
Copy link
Author

scabug commented May 21, 2013

@paulp said:
It's fixed in 2.10.2.

@scabug scabug closed this as completed May 21, 2013
@scabug scabug added this to the 2.10.2-RC1 milestone Apr 7, 2017
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