Scala Programming Language
  1. Scala Programming Language
  2. SI-4875

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0
    • Component/s: Misc Compiler
    • Labels:
      None
    • Environment:

      Welcome to Scala version 2.10.0.r25323-b20110719020429 (OpenJDK 64-Bit Server VM, Java 1.6.0_22).

      Description

      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.
      

        Issue Links

          Activity

          Hide
          Commit Message Bot added a comment -

          (extempore in r25911) Test case closes SI-4875.

          No review.

          Show
          Commit Message Bot added a comment - (extempore in r25911 ) Test case closes SI-4875 . No review.

            People

            • Assignee:
              Paul Phillips
              Reporter:
              Simon Ochsenreither
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development