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 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

This comment has been minimized.

Copy link
Author

@scabug 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

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 19, 2012

@scabug scabug closed this Jul 19, 2012
@scabug scabug added this to the 2.10.0-M5 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.