Details

      Description

      import scala.tools.nsc.reporters._
      import scala.tools.nsc.Settings
      import reflect.runtime.Mirror.ToolBox
      
      object Test extends App {
        val code = scala.reflect.Code.lift{
          new Object().getClass
        };
      
        val reporter = new ConsoleReporter(new Settings)
        val toolbox = new ToolBox(reporter)
        val ttree = toolbox.typeCheck(code.tree)
        toolbox.runExpr(ttree)
      }
      
      java.lang.StackOverflowError
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:229)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:299)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:279)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:299)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:290)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:299)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:290)
        at scala.reflect.internal.Importers$Importer.doImport$1(Importers.scala:43)
        at scala.reflect.internal.Importers$Importer.importOrRelink$1(Importers.scala:130)
        at scala.reflect.internal.Importers$Importer$$anonfun$importSymbol$1.apply(Importers.scala:132)
        at scala.reflect.internal.Importers$Importer$$anonfun$importSymbol$1.apply(Importers.scala:132)
        at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:169)
        at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)
        at scala.reflect.internal.Importers$Importer.importSymbol(Importers.scala:132)
        at scala.reflect.internal.Importers$Importer.importType(Importers.scala:137)
        at scala.reflect.internal.Importers$Importer$$anonfun$importType$1.apply(Importers.scala:137)
        at scala.reflect.internal.Importers$Importer$$anonfun$importType$1.apply(Importers.scala:137)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:77)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:237)
        at scala.collection.AbstractTraversable.map(Traversable.scala:112)
        at scala.reflect.internal.Importers$Importer.importType(Importers.scala:137)
        at scala.reflect.internal.Importers$Importer.importTree(Importers.scala:331)
        at scala.reflect.internal.Importers$Importer.doImport$1(Importers.scala:43)
        at scala.reflect.internal.Importers$Importer.importOrRelink$1(Importers.scala:130)
        at scala.reflect.internal.Importers$Importer$$anonfun$importSymbol$1.apply(Importers.scala:132)
        at scala.reflect.internal.Importers$Importer$$anonfun$importSymbol$1.apply(Importers.scala:132)
        at scala.collection.mutable.MapLike$class.getOrElseUpdate(MapLike.scala:169)
        at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:91)
        at scala.reflect.internal.Importers$Importer.importSymbol(Importers.scala:132)
        at scala.reflect.internal.Importers$Importer.importType(Importers.scala:137)
      

        Activity

        Hide
        Eugene Burmako added a comment -

        Probably related:

        import scala.reflect.mirror._
        
        object Test extends App {
          reify {
            class C { override def toString() = "C" }
            val ret = List((new C, new C))
            ret.asInstanceOf[List[_]]
          }.eval
        }
        
        undetParam added: type T
        undetParam added: type A
        undetParam added: type T1
        undetParam added: type T2
        undetParam inferred: type T1 as C
        undetParam inferred: type T2 as C
        undetParam inferred: type A as (C, C)
        undetParam inferred: type T as List[_$1]
        looking for macro implementation: macro method reify
        macroDef is annotated with: List(scala.reflect.makro.internal.macroImpl(Universe.reify[T]))
        resolved implementation method reify at NoPosition
        primary macro mirror: initializing from -cp: List(file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/resources.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/rt.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jsse.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jce.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/charsets.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/dnsns.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/localedata.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/sunjce_provider.jar, file:/C:/Projects/Kepler/lib/fjbg.jar, file:/C:/Projects/Kepler/build/locker/classes/compiler/, file:/C:/Projects/Kepler/build/locker/classes/library/, file:/C:/Projects/ScalaQuery/bin/scalaquery_2.9.1-0.10.0-SNAPSHOT.jar, file:/C:/Projects/Kepler/sandbox/./, file:/C:/PROGRA~2/QUICKT~1/QTSystem/QTJava.zip, file:/c:/PROGRA~1/Java/JDK16~1.0_2/lib/tools.jar, file:/C:/Program%20Files%20(x86)/QuickTime/QTSystem/QTJava.zip, file:/C:/Program%20Files%20(x86)/Java/jre6/lib/ext/QTJava.zip)
        loading implementation class from <primary macro mirror>: scala.reflect.api.Universe
        classloader is: Cl#272381940 of type class scala.tools.nsc.util.ScalaClassLoader$URLClassLoader
        classpath is: [file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/resources.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/rt.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jsse.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jce.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/charsets.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/dnsns.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/localedata.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/sunjce_provider.jar,file:/C:/Projects/Kepler/lib/fjbg.jar,file:/C:/Projects/Kepler/build/locker/classes/compiler/,file:/C:/Projects/Kepler/build/locker/classes/library/,file:/C:/Projects/ScalaQuery/bin/scalaquery_2.9.1-0.10.0-SNAPSHOT.jar,file:/C:/Projects/Kepler/sandbox/./,file:/C:/PROGRA~2/QUICKT~1/QTSystem/QTJava.zip,file:/c:/PROGRA~1/Java/JDK16~1.0_2/lib/tools.jar,file:/C:/Program%20Files%20(x86)/QuickTime/QTSystem/QTJava.zip,file:/C:/Program%20Files%20(x86)/Java/jre6/lib/ext/QTJava.zip]
        implClassSymbol is: scala.reflect.api.Universe
        implClass is class scala.reflect.api.Universe$ from (file:/C:/Projects/Kepler/build/locker/classes/library/ <no signer certificates>)
        implClassLoader is sun.misc.Launcher$AppClassLoader@3326b249 with classpath [file:/C:/Projects/Kepler/lib/fjbg.jar,file:/C:/Projects/Kepler/build/locker/classes/compiler/,file:/C:/Projects/Kepler/build/locker/classes/library/]
        implObjSymbol is: scala.reflect.api.Universe
        implMethSymbol is: scala.reflect.api.Universe.reify
        jimplMethSymbol is: public scala.reflect.api.Exprs$Expr scala.reflect.api.Universe$.reify(scala.reflect.makro.Context,scala.reflect.api.Exprs$Expr)
        successfully loaded macro impl as (scala.reflect.api.Universe$@47098a, method reify)
        calculateUndetparams: Set()
        typechecking macro expansion scala.reflect.`package`.mirror.reify[List[_$1]]({
          class C extends scala.AnyRef {
            def <init>(): C = {
              C.super.<init>();
              ()
            };
            override def toString(): String = "C"
          };
          val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C()));
          ret.asInstanceOf[List[_]]
        }) at source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65
        argss: List(List(MacroContext(reify@source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65 +0)), List(Expr[Nothing]({
          class C extends scala.AnyRef {
            def <init>(): C = {
              C.super.<init>();
              ()
            };
            override def toString(): String = "C"
          };
          val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C()));
          ret.asInstanceOf[List[_]]
        })))
        paramss: List(List(value cc), List(value expr))
        rawArgs: List(MacroContext(reify@source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65 +0), Expr[Nothing]({
          class C extends scala.AnyRef {
            def <init>(): C = {
              C.super.<init>();
              ()
            };
            override def toString(): String = "C"
          };
          val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C()));
          ret.asInstanceOf[List[_]]
        }))
        reifying = 
        {
          class C extends scala.AnyRef {
            def <init>(): C = {
              C.super.<init>();
              ()
            };
            override def toString(): String = "C"
          };
          val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C()));
          ret.asInstanceOf[List[_]]
        }
        Block(List(ClassDef(Modifiers(), newTypeName("C"), List(), Template(List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), newTermName("<init>"), List(), List(List()), TypeTree().setType(C), Block(List(Apply(Select(Super(This(newTypeName("")), newTypeName("")), newTermName("<init>")), List())), Literal(Constant(())))), DefDef(Modifiers(Set(`override`)), newTermName("toString"), List(), List(List()), TypeTree().setType(String), Literal(Constant("C")))))), ValDef(Modifiers(), newTermName("ret"), TypeTree().setType(List[(C, C)]), Apply(TypeApply(Select(Select(This(newTypeName("immutable")), newTermName("List")), newTermName("apply")), List(TypeTree().setType((C, C)))), List(Apply(TypeApply(Select(Select(Ident(newTermName("scala")), newTermName("Tuple2")), newTermName("apply")), List(TypeTree().setType(C), TypeTree().setType(C))), List(ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()), ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()))))))), TypeApply(Select(Ident(newTermName("ret")), newTermName("asInstanceOf")), List(TypeTree().setType(List[_]))))
        reifee is located at: source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65
        prefix = scala.reflect.`package`.mirror
        [calculate phase]
        boundSym: class C of type <notype>
        boundSym: constructor C of type C
        boundSym: method toString of type String
        boundSym: value ret of type List[(C, C)]
        [reshape phase]
        TypeTree, non-essential: C (TypeRef)
        verdict: discarded
        TypeTree, non-essential: String (TypeRef)
        verdict: discarded
        TypeTree, non-essential: List[(C, C)] (TypeRef)
        verdict: discarded
        discarding TypeApply: immutable.this.List.apply[(C, C)]
        discarding TypeApply: scala.Tuple2.apply[C, C]
        TypeTree, essential: List[_] (ExistentialType)
        verdict: rolled back to original List[_$1] forSome { 
          <synthetic> type _$1 >: _root_.scala.Nothing <: _root_.scala.Any
        }
        [metalevels phase]
        [interlude]
        symbol table = <empty>
        reifee = 
        {
          class C extends scala.AnyRef {
            def <init>(): C = {
              C.super.<init>();
              ()
            };
            override def toString(): String = "C"
          };
          val ret: List[(C, C)] = immutable.this.List.apply(scala.Tuple2.apply(new C(), new C()));
          ret.asInstanceOf[List[_$1] forSome { 
            <synthetic> type _$1 >: _root_.scala.Nothing <: _root_.scala.Any
          }]
        }
        Block(List(ClassDef(Modifiers(), newTypeName("C"), List(), Template(List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), newTermName("<init>"), List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(newTypeName("")), newTypeName("")), newTermName("<init>")), List())), Literal(Constant(())))), DefDef(Modifiers(Set(`override`)), newTermName("toString"), List(), List(List()), TypeTree(), Literal(Constant("C")))))), ValDef(Modifiers(), newTermName("ret"), TypeTree(), Apply(Select(Select(This(newTypeName("immutable")), newTermName("List")), newTermName("apply")), List(Apply(Select(Select(Ident(newTermName("scala")), newTermName("Tuple2")), newTermName("apply")), List(ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()), ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()))))))), TypeApply(Select(Ident(newTermName("ret")), newTermName("asInstanceOf")), List(ExistentialTypeTree(AppliedTypeTree(Ident(newTypeName("List")), List(Ident(newTypeName("_$1")))), List(TypeDef(Modifiers(Set(deferred)), newTypeName("_$1"), List(), TypeBoundsTree(Select(Select(Ident(newTermName("_root_")), newTermName("scala")), newTypeName("Nothing")), Select(Select(Ident(newTermName("_root_")), newTermName("scala")), newTypeName("Any")))))))))
        [reify phase]
        reifying bound type type AnyRef (underlying type is Object, dealiased is Object)
        tpe is locatable: reify as Ident(class Object)
        This for package immutable, reified as This
        macro expansion has failed: java.lang.Error: unexpected: bound type that doesn't have a tpe: Ident(newTypeName("List"))
        Test.scala:4: error: exception during macro expansion: 
        java.lang.Error: unexpected: bound type that doesn't have a tpe: Ident(newTypeName("List"))
          at scala.reflect.reify.codegen.Trees$class.reifyBoundType$1(Trees.scala:183)
          at scala.reflect.reify.codegen.Trees$class.reifyBoundType(Trees.scala:227)
          at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:57)
          at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45)
          at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34)
          at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45)
          at scala.reflect.reify.Reifier.reify(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
          at scala.collection.immutable.List.foreach(List.scala:77)
          at scala.collection.TraversableLike$class.map(TraversableLike.scala:237)
          at scala.collection.AbstractTraversable.map(Traversable.scala:105)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87)
          at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45)
          at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34)
          at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45)
          at scala.reflect.reify.Reifier.reify(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
          at scala.collection.immutable.List.foreach(List.scala:77)
          at scala.collection.TraversableLike$class.map(TraversableLike.scala:237)
          at scala.collection.AbstractTraversable.map(Traversable.scala:105)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87)
          at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45)
          at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34)
          at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45)
          at scala.reflect.reify.Reifier.reify(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyList$1.apply(Util.scala:18)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyList$1.apply(Util.scala:18)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
          at scala.collection.immutable.List.foreach(List.scala:77)
          at scala.collection.TraversableLike$class.map(TraversableLike.scala:237)
          at scala.collection.AbstractTraversable.map(Traversable.scala:105)
          at scala.reflect.reify.codegen.Util$class.reifyList(Util.scala:18)
          at scala.reflect.reify.Reifier.reifyList(Reifier.scala:14)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:58)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45)
          at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34)
          at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45)
          at scala.reflect.reify.Reifier.reify(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
          at scala.collection.immutable.List.foreach(List.scala:77)
          at scala.collection.TraversableLike$class.map(TraversableLike.scala:237)
          at scala.collection.AbstractTraversable.map(Traversable.scala:105)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87)
          at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45)
          at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34)
          at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45)
          at scala.reflect.reify.Reifier.reify(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237)
          at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
          at scala.collection.immutable.List.foreach(List.scala:77)
          at scala.collection.TraversableLike$class.map(TraversableLike.scala:237)
          at scala.collection.AbstractTraversable.map(Traversable.scala:105)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21)
          at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14)
          at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87)
          at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52)
          at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45)
          at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34)
          at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45)
          at scala.reflect.reify.Reifier.reify(Reifier.scala:14)
          at scala.reflect.reify.Phases$$anonfun$mkReificationPipeline$1.apply(Phases.scala:38)
          at scala.reflect.reify.Phases$$anonfun$mkReificationPipeline$1.apply(Phases.scala:18)
          at scala.reflect.reify.Reifier.liftedTree1$1(Reifier.scala:61)
          at scala.reflect.reify.Reifier.reified(Reifier.scala:47)
          at scala.reflect.reify.package$.reifyTree(package.scala:26)
          at scala.reflect.makro.runtime.Reifiers$class.reifyTree(Reifiers.scala:18)
          at scala.reflect.makro.runtime.Context.reifyTree(Context.scala:6)
          at scala.reflect.makro.internal.Utils$$anonfun$2.apply(Utils.scala:117)
          at scala.reflect.makro.internal.Utils$$anonfun$2.apply(Utils.scala:117)
          at scala.reflect.makro.internal.Utils.translatingReificationErrors(Utils.scala:123)
          at scala.reflect.makro.internal.Utils.materializeExpr(Utils.scala:117)
          at scala.reflect.api.Universe$.reify(Universe.scala:69)
        
          reify {
                ^
        one error found
        
        Show
        Eugene Burmako added a comment - Probably related: import scala.reflect.mirror._ object Test extends App { reify { class C { override def toString() = "C" } val ret = List((new C, new C)) ret.asInstanceOf[List[_]] }.eval } undetParam added: type T undetParam added: type A undetParam added: type T1 undetParam added: type T2 undetParam inferred: type T1 as C undetParam inferred: type T2 as C undetParam inferred: type A as (C, C) undetParam inferred: type T as List[_$1] looking for macro implementation: macro method reify macroDef is annotated with: List(scala.reflect.makro.internal.macroImpl(Universe.reify[T])) resolved implementation method reify at NoPosition primary macro mirror: initializing from -cp: List(file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/resources.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/rt.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jsse.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jce.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/charsets.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/dnsns.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/localedata.jar, file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/sunjce_provider.jar, file:/C:/Projects/Kepler/lib/fjbg.jar, file:/C:/Projects/Kepler/build/locker/classes/compiler/, file:/C:/Projects/Kepler/build/locker/classes/library/, file:/C:/Projects/ScalaQuery/bin/scalaquery_2.9.1-0.10.0-SNAPSHOT.jar, file:/C:/Projects/Kepler/sandbox/./, file:/C:/PROGRA~2/QUICKT~1/QTSystem/QTJava.zip, file:/c:/PROGRA~1/Java/JDK16~1.0_2/lib/tools.jar, file:/C:/Program%20Files%20(x86)/QuickTime/QTSystem/QTJava.zip, file:/C:/Program%20Files%20(x86)/Java/jre6/lib/ext/QTJava.zip) loading implementation class from <primary macro mirror>: scala.reflect.api.Universe classloader is: Cl#272381940 of type class scala.tools.nsc.util.ScalaClassLoader$URLClassLoader classpath is: [file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/resources.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/rt.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jsse.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/jce.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/charsets.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/dnsns.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/localedata.jar,file:/c:/PROGRA~1/Java/JDK16~1.0_2/jre/lib/ext/sunjce_provider.jar,file:/C:/Projects/Kepler/lib/fjbg.jar,file:/C:/Projects/Kepler/build/locker/classes/compiler/,file:/C:/Projects/Kepler/build/locker/classes/library/,file:/C:/Projects/ScalaQuery/bin/scalaquery_2.9.1-0.10.0-SNAPSHOT.jar,file:/C:/Projects/Kepler/sandbox/./,file:/C:/PROGRA~2/QUICKT~1/QTSystem/QTJava.zip,file:/c:/PROGRA~1/Java/JDK16~1.0_2/lib/tools.jar,file:/C:/Program%20Files%20(x86)/QuickTime/QTSystem/QTJava.zip,file:/C:/Program%20Files%20(x86)/Java/jre6/lib/ext/QTJava.zip] implClassSymbol is: scala.reflect.api.Universe implClass is class scala.reflect.api.Universe$ from (file:/C:/Projects/Kepler/build/locker/classes/library/ <no signer certificates>) implClassLoader is sun.misc.Launcher$AppClassLoader@3326b249 with classpath [file:/C:/Projects/Kepler/lib/fjbg.jar,file:/C:/Projects/Kepler/build/locker/classes/compiler/,file:/C:/Projects/Kepler/build/locker/classes/library/] implObjSymbol is: scala.reflect.api.Universe implMethSymbol is: scala.reflect.api.Universe.reify jimplMethSymbol is: public scala.reflect.api.Exprs$Expr scala.reflect.api.Universe$.reify(scala.reflect.makro.Context,scala.reflect.api.Exprs$Expr) successfully loaded macro impl as (scala.reflect.api.Universe$@47098a, method reify) calculateUndetparams: Set() typechecking macro expansion scala.reflect.`package`.mirror.reify[List[_$1]]({ class C extends scala.AnyRef { def <init>(): C = { C.super.<init>(); () }; override def toString(): String = "C" }; val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C())); ret.asInstanceOf[List[_]] }) at source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65 argss: List(List(MacroContext(reify@source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65 +0)), List(Expr[Nothing]({ class C extends scala.AnyRef { def <init>(): C = { C.super.<init>(); () }; override def toString(): String = "C" }; val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C())); ret.asInstanceOf[List[_]] }))) paramss: List(List(value cc), List(value expr)) rawArgs: List(MacroContext(reify@source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65 +0), Expr[Nothing]({ class C extends scala.AnyRef { def <init>(): C = { C.super.<init>(); () }; override def toString(): String = "C" }; val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C())); ret.asInstanceOf[List[_]] })) reifying = { class C extends scala.AnyRef { def <init>(): C = { C.super.<init>(); () }; override def toString(): String = "C" }; val ret: List[(C, C)] = immutable.this.List.apply[(C, C)](scala.Tuple2.apply[C, C](new C(), new C())); ret.asInstanceOf[List[_]] } Block(List(ClassDef(Modifiers(), newTypeName("C"), List(), Template(List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), newTermName("<init>"), List(), List(List()), TypeTree().setType(C), Block(List(Apply(Select(Super(This(newTypeName("")), newTypeName("")), newTermName("<init>")), List())), Literal(Constant(())))), DefDef(Modifiers(Set(`override`)), newTermName("toString"), List(), List(List()), TypeTree().setType(String), Literal(Constant("C")))))), ValDef(Modifiers(), newTermName("ret"), TypeTree().setType(List[(C, C)]), Apply(TypeApply(Select(Select(This(newTypeName("immutable")), newTermName("List")), newTermName("apply")), List(TypeTree().setType((C, C)))), List(Apply(TypeApply(Select(Select(Ident(newTermName("scala")), newTermName("Tuple2")), newTermName("apply")), List(TypeTree().setType(C), TypeTree().setType(C))), List(ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()), ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()))))))), TypeApply(Select(Ident(newTermName("ret")), newTermName("asInstanceOf")), List(TypeTree().setType(List[_])))) reifee is located at: source-C:\Projects\Kepler\sandbox\Test.scala,line-4,offset=65 prefix = scala.reflect.`package`.mirror [calculate phase] boundSym: class C of type <notype> boundSym: constructor C of type C boundSym: method toString of type String boundSym: value ret of type List[(C, C)] [reshape phase] TypeTree, non-essential: C (TypeRef) verdict: discarded TypeTree, non-essential: String (TypeRef) verdict: discarded TypeTree, non-essential: List[(C, C)] (TypeRef) verdict: discarded discarding TypeApply: immutable.this.List.apply[(C, C)] discarding TypeApply: scala.Tuple2.apply[C, C] TypeTree, essential: List[_] (ExistentialType) verdict: rolled back to original List[_$1] forSome { <synthetic> type _$1 >: _root_.scala.Nothing <: _root_.scala.Any } [metalevels phase] [interlude] symbol table = <empty> reifee = { class C extends scala.AnyRef { def <init>(): C = { C.super.<init>(); () }; override def toString(): String = "C" }; val ret: List[(C, C)] = immutable.this.List.apply(scala.Tuple2.apply(new C(), new C())); ret.asInstanceOf[List[_$1] forSome { <synthetic> type _$1 >: _root_.scala.Nothing <: _root_.scala.Any }] } Block(List(ClassDef(Modifiers(), newTypeName("C"), List(), Template(List(Select(Ident(newTermName("scala")), newTypeName("AnyRef"))), emptyValDef, List(DefDef(Modifiers(), newTermName("<init>"), List(), List(List()), TypeTree(), Block(List(Apply(Select(Super(This(newTypeName("")), newTypeName("")), newTermName("<init>")), List())), Literal(Constant(())))), DefDef(Modifiers(Set(`override`)), newTermName("toString"), List(), List(List()), TypeTree(), Literal(Constant("C")))))), ValDef(Modifiers(), newTermName("ret"), TypeTree(), Apply(Select(Select(This(newTypeName("immutable")), newTermName("List")), newTermName("apply")), List(Apply(Select(Select(Ident(newTermName("scala")), newTermName("Tuple2")), newTermName("apply")), List(ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()), ApplyConstructor(Select(New(Ident(newTypeName("C"))), newTermName("<init>")), List()))))))), TypeApply(Select(Ident(newTermName("ret")), newTermName("asInstanceOf")), List(ExistentialTypeTree(AppliedTypeTree(Ident(newTypeName("List")), List(Ident(newTypeName("_$1")))), List(TypeDef(Modifiers(Set(deferred)), newTypeName("_$1"), List(), TypeBoundsTree(Select(Select(Ident(newTermName("_root_")), newTermName("scala")), newTypeName("Nothing")), Select(Select(Ident(newTermName("_root_")), newTermName("scala")), newTypeName("Any"))))))))) [reify phase] reifying bound type type AnyRef (underlying type is Object, dealiased is Object) tpe is locatable: reify as Ident(class Object) This for package immutable, reified as This macro expansion has failed: java.lang.Error: unexpected: bound type that doesn't have a tpe: Ident(newTypeName("List")) Test.scala:4: error: exception during macro expansion: java.lang.Error: unexpected: bound type that doesn't have a tpe: Ident(newTypeName("List")) at scala.reflect.reify.codegen.Trees$class.reifyBoundType$1(Trees.scala:183) at scala.reflect.reify.codegen.Trees$class.reifyBoundType(Trees.scala:227) at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:57) at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45) at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34) at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45) at scala.reflect.reify.Reifier.reify(Reifier.scala:14) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:77) at scala.collection.TraversableLike$class.map(TraversableLike.scala:237) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87) at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45) at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34) at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45) at scala.reflect.reify.Reifier.reify(Reifier.scala:14) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:77) at scala.collection.TraversableLike$class.map(TraversableLike.scala:237) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87) at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45) at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34) at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45) at scala.reflect.reify.Reifier.reify(Reifier.scala:14) at scala.reflect.reify.codegen.Util$$anonfun$reifyList$1.apply(Util.scala:18) at scala.reflect.reify.codegen.Util$$anonfun$reifyList$1.apply(Util.scala:18) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:77) at scala.collection.TraversableLike$class.map(TraversableLike.scala:237) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at scala.reflect.reify.codegen.Util$class.reifyList(Util.scala:18) at scala.reflect.reify.Reifier.reifyList(Reifier.scala:14) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:58) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45) at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34) at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45) at scala.reflect.reify.Reifier.reify(Reifier.scala:14) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:77) at scala.collection.TraversableLike$class.map(TraversableLike.scala:237) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87) at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45) at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34) at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45) at scala.reflect.reify.Reifier.reify(Reifier.scala:14) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.reflect.reify.codegen.Util$$anonfun$reifyProduct$2.apply(Util.scala:26) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:237) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59) at scala.collection.immutable.List.foreach(List.scala:77) at scala.collection.TraversableLike$class.map(TraversableLike.scala:237) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:26) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Util$class.reifyProduct(Util.scala:21) at scala.reflect.reify.Reifier.reifyProduct(Reifier.scala:14) at scala.reflect.reify.codegen.Trees$class.reifyTree(Trees.scala:87) at scala.reflect.reify.Reifier.reifyTree(Reifier.scala:14) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:52) at scala.reflect.reify.phases.Reify$$anonfun$reify$1.apply(Reify.scala:45) at scala.reflect.reify.phases.Reify$reifyStack$.push(Reify.scala:34) at scala.reflect.reify.phases.Reify$class.reify(Reify.scala:45) at scala.reflect.reify.Reifier.reify(Reifier.scala:14) at scala.reflect.reify.Phases$$anonfun$mkReificationPipeline$1.apply(Phases.scala:38) at scala.reflect.reify.Phases$$anonfun$mkReificationPipeline$1.apply(Phases.scala:18) at scala.reflect.reify.Reifier.liftedTree1$1(Reifier.scala:61) at scala.reflect.reify.Reifier.reified(Reifier.scala:47) at scala.reflect.reify.package$.reifyTree(package.scala:26) at scala.reflect.makro.runtime.Reifiers$class.reifyTree(Reifiers.scala:18) at scala.reflect.makro.runtime.Context.reifyTree(Context.scala:6) at scala.reflect.makro.internal.Utils$$anonfun$2.apply(Utils.scala:117) at scala.reflect.makro.internal.Utils$$anonfun$2.apply(Utils.scala:117) at scala.reflect.makro.internal.Utils.translatingReificationErrors(Utils.scala:123) at scala.reflect.makro.internal.Utils.materializeExpr(Utils.scala:117) at scala.reflect.api.Universe$.reify(Universe.scala:69) reify { ^ one error found
        Hide
        Eugene Burmako added a comment -

        Promoting to critical, because it affects generation of type tags (which makes this bug a regression w.r.t manifests).

        Show
        Eugene Burmako added a comment - Promoting to critical, because it affects generation of type tags (which makes this bug a regression w.r.t manifests).
        Hide
        Eugene Burmako added a comment -

        The problem here is in toolboxes. Existential types are reified okishly.

        Show
        Eugene Burmako added a comment - The problem here is in toolboxes. Existential types are reified okishly.
        Hide
        Eugene Burmako added a comment -
        Show
        Eugene Burmako added a comment - Related to https://issues.scala-lang.org/browse/SI-6386
        Show
        Eugene Burmako added a comment - https://github.com/scala/scala/pull/1338
        Show
        Grzegorz Kossakowski added a comment - Fixed in https://github.com/scala/scala/pull/1338

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Eugene Burmako
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development