Details

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

      Description

      import scala.reflect.
      
      object Foo extends App {
        Code.lift{def printf(format: String, args: Any*): String = (null: @cloneable)}
      }
      
      error: java.lang.ClassCastException: scala.reflect.internal.AnnotationInfos$CompleteAnnotationInfo cannot be cast to scala.Product
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:522)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$scala$tools$nsc$transform$LiftCode$Reifier$$reify$1.apply(LiftCode.scala:512)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$scala$tools$nsc$transform$LiftCode$Reifier$$reify$1.apply(LiftCode.scala:512)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
      	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:233)
      	at scala.collection.AbstractTraversable.map(Traversable.scala:112)
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:512)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.collection.Iterator$$anon$11.next(Iterator.scala:316)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:690)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1115)
      	at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
      	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:132)
      	at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:242)
      	at scala.collection.AbstractIterator.toList(Iterator.scala:1115)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyCaseClassInstance(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyType(LiftCode.scala:455)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyTree(LiftCode.scala:482)
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:506)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.collection.Iterator$$anon$11.next(Iterator.scala:316)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:690)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1115)
      	at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
      	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:132)
      	at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:242)
      	at scala.collection.AbstractIterator.toList(Iterator.scala:1115)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyCaseClassInstance(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyTree(LiftCode.scala:485)
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:506)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.collection.Iterator$$anon$11.next(Iterator.scala:316)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:690)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1115)
      	at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
      	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:132)
      	at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:242)
      	at scala.collection.AbstractIterator.toList(Iterator.scala:1115)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyCaseClassInstance(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyTree(LiftCode.scala:485)
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:506)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$scala$tools$nsc$transform$LiftCode$Reifier$$reify$1.apply(LiftCode.scala:512)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$scala$tools$nsc$transform$LiftCode$Reifier$$reify$1.apply(LiftCode.scala:512)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
      	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
      	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:233)
      	at scala.collection.AbstractTraversable.map(Traversable.scala:112)
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:512)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier$$anonfun$reifyCaseClassInstance$1.apply(LiftCode.scala:338)
      	at scala.collection.Iterator$$anon$11.next(Iterator.scala:316)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:690)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1115)
      	at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:48)
      	at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:132)
      	at scala.collection.TraversableOnce$class.toList(TraversableOnce.scala:242)
      	at scala.collection.AbstractIterator.toList(Iterator.scala:1115)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyCaseClassInstance(LiftCode.scala:338)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyTree(LiftCode.scala:485)
      	at scala.tools.nsc.transform.LiftCode$Reifier.scala$tools$nsc$transform$LiftCode$Reifier$$reify(LiftCode.scala:506)
      	at scala.tools.nsc.transform.LiftCode$Reifier.reifyTopLevel(LiftCode.scala:290)
      	at scala.tools.nsc.transform.LiftCode$Codifier.codify(LiftCode.scala:158)
      	at scala.tools.nsc.transform.LiftCode$Codifier.transform(LiftCode.scala:127)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1$$anonfun$apply$2.apply(Trees.scala:1249)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1$$anonfun$apply$2.apply(Trees.scala:1249)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1257)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:19)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1249)
      	at scala.reflect.api.Trees$Transformer$$anonfun$transformStats$1.apply(Trees.scala:1248)
      	at scala.collection.immutable.List.loop$1(List.scala:151)
      	at scala.collection.immutable.List.mapConserve(List.scala:167)
      	at scala.reflect.api.Trees$Transformer.transformStats(Trees.scala:1248)
      	at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1160)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.scala$tools$nsc$transform$TypingTransformers$TypingTransformer$$super$transform(TypingTransformers.scala:49)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer$$anonfun$transform$1.apply(TypingTransformers.scala:49)
      	at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:1257)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:38)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.atOwner(TypingTransformers.scala:31)
      	at scala.tools.nsc.transform.TypingTransformers$TypingTransformer.transform(TypingTransformers.scala:49)
      	at scala.tools.nsc.transform.LiftCode$Codifier.transform(LiftCode.scala:151)
      	at scala.reflect.api.Trees$Transformer.transformTemplate(Trees.scala:1234)
      

        Activity

        Hide
        Commit Message Bot added a comment -

        (extempore in r26072) Annotations reacquainted with reification.

        Had AnnotationInfo extend Product3 since it's no longer a case class.
        Tried to make reflection a little more robust. Closes SI-5223, review by vogt.

        Show
        Commit Message Bot added a comment - (extempore in r26072 ) Annotations reacquainted with reification. Had AnnotationInfo extend Product3 since it's no longer a case class. Tried to make reflection a little more robust. Closes SI-5223 , review by vogt.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development