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

crash in reify with _* #5824

Closed
scabug opened this issue May 23, 2012 · 3 comments
Closed

crash in reify with _* #5824

scabug opened this issue May 23, 2012 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented May 23, 2012

import scala.reflect.makro.Context

object Macros {
  def foo(c: Context) = {
    import c.mirror._
    val ids = collection.mutable.ListBuffer[Ident]()
    //val expr =
    //  Apply(
    //    Select(
    //      Literal(Constant("hey")),
    //      newTermName("format")),
    //    List(ids: _* )
    //  )
    val expr = c.reify("hey".format((ids.map(id => Expr(id).eval)) : _*))
    expr
  }
}
C:\Projects\Kepler\sandbox @ master>myke compile Test.scala
Test.scala:14: error: exception during macro expansion:
scala.MatchError: (ids.map[Nothing, scala.collection.mutable.ListBuffer[Nothing]](((id: c.mirror.Ident) => c.mirror.Expr.apply[Nothing](id)(c.mirror.TypeTag.Nothing).eval))(mutable.this.ListBuffer.canBuildFrom[Nothing]): _*) (of class sc
ala.reflect.api.Trees$Typed)
        at scala.reflect.reify.phases.Reshape$$anon$1.toPreTyperTypedOrAnnotated(Reshape.scala:157)
        at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:35)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1549)
        at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:1549)
        at scala.collection.immutable.List.loop$1(List.scala:163)
        at scala.collection.immutable.List.mapConserve(List.scala:179)
        at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:1549)
        at scala.reflect.api.Trees$Transformer.transform(Trees.scala:1513)
        at scala.reflect.reify.phases.Reshape$$anon$1.transform(Reshape.scala:85)
        at scala.reflect.reify.Phases$$anonfun$mkReificationPipeline$1.apply(Phases.scala:28)
        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.makro.Context$.reify(Context.scala:42)

    val expr = c.reify("hey".format((ids.map(id => Expr(id).eval)) : _*))
                      ^
one error found
@scabug
Copy link
Author

@scabug scabug commented May 23, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5824?orig=1
Reporter: @xeno-by
Affected Versions: 2.10.0-M3

Loading

@scabug
Copy link
Author

@scabug scabug commented Nov 26, 2012

@xeno-by said:
The issue is being fixed.

Loading

@scabug
Copy link
Author

@scabug scabug commented Feb 7, 2013

@xeno-by said (edited on Feb 7, 2013 5:57:48 PM UTC):
scala/scala#2085

Loading

@scabug scabug closed this Feb 8, 2013
@scabug scabug added this to the 2.10.1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants