Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: Scala 2.10.0-M5
    • Component/s: Macros
    • Labels:
      None

      Description

      import language.experimental.macros
      import scala.reflect.makro.Context
      import java.io.InputStream
      
      object Macros {
         def unpack[A](input: InputStream): A = macro unpack_impl[A]
      
         def unpack_impl[A: c.TypeTag](c: Context)(input:
       c.Expr[InputStream]): c.Expr[A] = {
           import c.universe._
      
           def unpackcode(tpe: c.Type): c.Expr[_] = {
             if (tpe <:< implicitly[c.AbsTypeTag[Traversable[_]]].tpe) {
      
             }
             ???
           }
      
           unpackcode(c.typeOf[A])
           ???
         }
       }
      
      typechecking macro def macro method unpack at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-5,offset=86
      generating macroImplSigs for: macro method unpack
      tparams are: List(type A >: _root_.scala.Nothing <: _root_.scala.Any)
      vparamss are: List(List(val input: InputStream = _))
      retTpe is: A
      macroImplSigs are: (List(List(List(value c), List(value input))),c.universe.Expr[A])
      considering 1 possibilities of compatible macro impl signatures for macro def: unpack
      scala.reflect.makro.Context <: scala.reflect.makro.Context?
      true
      c.universe.Expr[java.io.InputStream] <: c.universe.Expr[java.io.InputStream]?
      true
      c.universe.Expr[?A] <: c.universe.Expr[A]?
      true
      [  OK  ] List(List(value c), List(value input))
      typechecked macro impl as: List(List(value c), List(value input))
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for c.TypeTag[Traversable[_]] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      materializing requested c.universe.type.TypeTag[Traversable[_]] using `package`.this.materializeTypeTag[Traversable[_]](c.universe)
      looking for macro implementation: macro method materializeTypeTag
      macro expansion is serviced by a fast track
      calculateUndetparams: Set()
      typechecking macro expansion `package`.this.materializeTypeTag[Traversable[_]](c.universe) at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402
      looking for macro implementation: macro method materializeTypeTag
      macro expansion is serviced by a fast track
      argss: List(List(MacroContext(materializeTypeTag@source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402 +0)), List(Expr[Nothing](c.universe)))
      rawArgs: List(MacroContext(materializeTypeTag@source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402 +0), Expr[Nothing](c.universe))
      inferring implicit value of type scala.reflect.base.Universe#TypeTag[Traversable[_]], macros = false
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for scala.reflect.base.Universe#TypeTag[Traversable[_]] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      implicit search has failed. to find out the reason, turn on -Xlog-implicits
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for c.universe.TypeTag[c.Type] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      materializing requested c.universe.type.TypeTag[c.Type] using `package`.this.materializeTypeTag[c.Type](c.universe)
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for scala.reflect.base.Universe#TypeTag[c.Type] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      macro expansion has failed: cannot reify TypeTag having unresolved type parameter c.Type at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402
      Macros_1.scala:13: `package`.this.materializeTypeTag[Traversable[_]](c.universe) is not a valid implicit value for c.TypeTag[Traversable[_]] because:
      failed to typecheck the materialized tag: 
      cannot reify TypeTag having unresolved type parameter c.Type
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for c.TypeTag[Traversable[_]] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      materializing requested c.universe.type.TypeTag[Traversable[_]] using `package`.this.materializeTypeTag[Traversable[_]](c.universe)
      looking for macro implementation: macro method materializeTypeTag
      macro expansion is serviced by a fast track
      calculateUndetparams: Set()
      typechecking macro expansion `package`.this.materializeTypeTag[Traversable[_]](c.universe) at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402
      looking for macro implementation: macro method materializeTypeTag
      macro expansion is serviced by a fast track
      argss: List(List(MacroContext(materializeTypeTag@source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402 +0)), List(Expr[Nothing](c.universe)))
      rawArgs: List(MacroContext(materializeTypeTag@source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402 +0), Expr[Nothing](c.universe))
      inferring implicit value of type scala.reflect.base.Universe#TypeTag[Traversable[_]], macros = false
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for scala.reflect.base.Universe#TypeTag[Traversable[_]] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      implicit search has failed. to find out the reason, turn on -Xlog-implicits
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for c.universe.TypeTag[c.Type] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      materializing requested c.universe.type.TypeTag[c.Type] using `package`.this.materializeTypeTag[c.Type](c.universe)
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for scala.reflect.base.Universe#TypeTag[c.Type] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      macro expansion has failed: cannot reify TypeTag having unresolved type parameter c.Type at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402
      Macros_1.scala:13: `package`.this.materializeTypeTag[Traversable[_]](c.universe) is not a valid implicit value for c.TypeTag[Traversable[_]] because:
      failed to typecheck the materialized tag: 
      cannot reify TypeTag having unresolved type parameter c.Type
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for c.TypeTag[Traversable[_]] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      materializing requested c.universe.type.TypeTag[Traversable[_]] using `package`.this.materializeTypeTag[Traversable[_]](c.universe)
      looking for macro implementation: macro method materializeTypeTag
      macro expansion is serviced by a fast track
      calculateUndetparams: Set()
      typechecking macro expansion `package`.this.materializeTypeTag[Traversable[_]](c.universe) at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402
      looking for macro implementation: macro method materializeTypeTag
      macro expansion is serviced by a fast track
      argss: List(List(MacroContext(materializeTypeTag@source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402 +0)), List(Expr[Nothing](c.universe)))
      rawArgs: List(MacroContext(materializeTypeTag@source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402 +0), Expr[Nothing](c.universe))
      inferring implicit value of type scala.reflect.base.Universe#TypeTag[Traversable[_]], macros = false
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for scala.reflect.base.Universe#TypeTag[Traversable[_]] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      implicit search has failed. to find out the reason, turn on -Xlog-implicits
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for c.universe.TypeTag[c.Type] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      materializing requested c.universe.type.TypeTag[c.Type] using `package`.this.materializeTypeTag[c.Type](c.universe)
      Macros_1.scala:13: <evidence$1: error> is not a valid implicit value for scala.reflect.base.Universe#TypeTag[c.Type] because:
      hasMatchingSymbol reported threw error(s)
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      macro expansion has failed: cannot reify TypeTag having unresolved type parameter c.Type at source-C:\Projects\Kepler\sandbox\Macros_1.scala,line-13,offset=402
      Macros_1.scala:13: `package`.this.materializeTypeTag[Traversable[_]](c.universe) is not a valid implicit value for c.TypeTag[Traversable[_]] because:
      failed to typecheck the materialized tag: 
      cannot reify TypeTag having unresolved type parameter c.Type
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      Macros_1.scala:13: error: No TypeTag available for Traversable[_]
             if (tpe <:< c.typeOf[Traversable[_]]) {
                                 ^
      one error found
      

        Activity

        Hide
        Eugene Burmako added a comment -

        No longer reproducible in M5.

        Show
        Eugene Burmako added a comment - No longer reproducible in M5.
        Hide
        Hubert Plociniczak added a comment -

        I guess it still warrants a test case, right?

        Show
        Hubert Plociniczak added a comment - I guess it still warrants a test case, right?
        Hide
        Eugene Burmako added a comment -
        Show
        Eugene Burmako added a comment - Sure thing: https://github.com/scala/scala/pull/923 .

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development