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

Case class typeOf not working: bad reference while unpickling $line3.$read: type AnyRef not found in scala.type #6086

Closed
scabug opened this issue Jul 15, 2012 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jul 15, 2012

It seems getting the typeOf a case class doesn't work:

scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._

scala> case class X(s: String)
defined class X

scala> typeOf[X]
scala.reflect.internal.Types$TypeError: bad reference while unpickling $line11.$read: type AnyRef not found in scala.type
        at scala.reflect.internal.pickling.UnPickler$Scan.toTypeError(UnPickler.scala:832)
        at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:846)
        at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.load(UnPickler.scala:848)
        at scala.reflect.internal.Symbols$Symbol$$anonfun$typeParams$1.apply$mcV$sp(Symbols.scala:1625)
        at scala.reflect.internal.Symbols$Symbol$$anonfun$typeParams$1.apply(Symbols.scala:1625)
        at scala.reflect.internal.Symbols$Symbol$$anonfun$typeParams$1.apply(Symbols.scala:1625)
        at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:195)
        at scala.reflect.internal.Symbols$Symbol.typeParams(Symbols.scala:1625)
        at scala.reflect.internal.Types$NoArgsTypeRef.typeParams(Types.scala:2021)
        at scala.reflect.internal.Types$NoArgsTypeRef.isHigherKinded(Types.scala:2020)
        at scala.reflect.internal.Types$NoArgsTypeRef.normalizeImpl(Types.scala:2054)
        at scala.reflect.internal.Types$TypeRef.normalize(Types.scala:2235)
        at scala.reflect.internal.Definitions$DefinitionsClass.isFunctionType(Definitions.scala:648)
        at scala.reflect.internal.Types$TypeRef.customToString(Types.scala:2340)
        at scala.reflect.internal.Types$TypeRef.safeToString(Types.scala:2362)
        at scala.reflect.internal.Types$class.typeToString(Types.scala:6877)
        at scala.reflect.runtime.JavaUniverse.scala$reflect$runtime$SynchronizedTypes$$super$typeToString(JavaUniverse.scala:9)
        at scala.reflect.runtime.SynchronizedTypes$class.typeToString(SynchronizedTypes.scala:61)
        at scala.reflect.runtime.JavaUniverse.typeToString(JavaUniverse.scala:9)
        at scala.reflect.internal.Types$Type.toString(Types.scala:969)
        at scala.runtime.ScalaRunTime$.scala$runtime$ScalaRunTime$$inner$1(ScalaRunTime.scala:354)
        at scala.runtime.ScalaRunTime$.stringOf(ScalaRunTime.scala:359)
        at scala.runtime.ScalaRunTime$.replStringOf(ScalaRunTime.scala:367)
        at .<init>(<console>:10)
        at .<clinit>(<console>)
        at $print(<console>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:736)
        at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:991)
        at scala.tools.nsc.interpreter.IMain.loadAndRunReq$1(IMain.scala:579)
        at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:610)
        at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:574)
        at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:742)
        at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:787)
        at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:699)
        at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:563)
        at scala.tools.nsc.interpreter.ILoop.innerLoop$1(ILoop.scala:570)
        at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:573)
        at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:864)
        at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:819)
        at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:819)
        at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)
        at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:819)
        at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:79)
        at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:92)
        at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:101)
        at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@scabug
Copy link
Author

scabug commented Jul 15, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6086?orig=1
Reporter: @dcsobral
Affected Versions: 2.10.0-M5

@scabug
Copy link
Author

scabug commented Jul 19, 2012

@adriaanm said:
scala/scala#919

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