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

scala.reflect.internal.Types$TypeError: cannot reify tree #4875

Closed
scabug opened this issue Aug 5, 2011 · 2 comments
Closed

scala.reflect.internal.Types$TypeError: cannot reify tree #4875

scabug opened this issue Aug 5, 2011 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Aug 5, 2011

scala> import scala.reflect.Code
import scala.reflect.Code

scala> def codeOf[A](code: Code[A]) = code
codeOf: [A](code: scala.reflect.Code[A])scala.reflect.Code[A]

scala> codeOf((x: Iterable[_]) => throw new Exception)
could not reify: Iterable[_]
scala.reflect.internal.Types$TypeError: cannot reify tree (class scala.reflect.api.Trees$Throw): throw new scala.`package`.Exception()
	at scala.tools.nsc.transform.Reifiers$Reifier.reify(Reifiers.scala:313)
	at scala.tools.nsc.transform.Reifiers$Reifier.reify(Reifiers.scala:250)
	at scala.tools.nsc.transform.Reifiers$class.reify(Reifiers.scala:329)
	at scala.tools.nsc.transform.LiftCode.reify(LiftCode.scala:21)
	at scala.tools.nsc.transform.LiftCode.codify(LiftCode.scala:113)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:39)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1214)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1214)
	at scala.collection.immutable.List.loop$1(List.scala:118)
	at scala.collection.immutable.List.mapConserve(List.scala:134)
	at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:1214)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1180)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:1124)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$4.apply(Trees.scala:1123)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1239)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1122)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1232)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1230)
	at scala.collection.immutable.List.loop$1(List.scala:118)
	at scala.collection.immutable.List.mapConserve(List.scala:134)
	at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1230)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1142)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1216)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1114)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1113)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1239)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1112)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1232)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1230)
	at scala.collection.immutable.List.loop$1(List.scala:118)
	at scala.collection.immutable.List.mapConserve(List.scala:134)
	at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1230)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1142)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1216)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1114)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1113)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1239)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1112)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1232)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1230)
	at scala.collection.immutable.List.loop$1(List.scala:118)
	at scala.collection.immutable.List.mapConserve(List.scala:134)
	at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1230)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1142)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1216)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1114)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$2.apply(Trees.scala:1113)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1239)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1112)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1232)
	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1230)
	at scala.collection.immutable.List.loop$1(List.scala:118)
	at scala.collection.immutable.List.mapConserve(List.scala:134)
	at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1230)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:1108)
	at scala.reflect.api.Trees$Transformer$$anonfun$transform$1.apply(Trees.scala:1108)
	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1239)
	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1107)
	at scala.tools.nsc.transform.LiftCode$AddRefFields.transform(LiftCode.scala:41)
	at scala.tools.nsc.ast.Trees$Transformer.transformUnit(Trees.scala:204)
	at scala.tools.nsc.transform.Transform$Phase.apply(Transform.scala:30)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:353)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:321)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:321)
	at scala.collection.Iterator$class.foreach(Iterator.scala:663)
	at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:316)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:321)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:999)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:754)
	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:729)
	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:871)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:574)
	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:541)
	at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:691)
	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:742)
	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:648)
	at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:539)
	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:547)
	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:819)
	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:67)
	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80)
	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89)
	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

That entry seems to have slain the compiler.  Shall I replay
your session? I can re-run each line except the last one.
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Aug 5, 2011

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Oct 29, 2011

Commit Message Bot (anonymous) said:
(extempore in r25911) Test case closes #4875.

No review.

@scabug scabug closed this Oct 29, 2011
@scabug scabug added this to the 2.10.0 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.