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

"macro not expanded" error with argument containing implicit view, inferred Nothing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.3
    • Fix Version/s: Scala 2.11.0-M7
    • Component/s: Macros
    • Labels:
      None

      Description

      scala> import scala.language.experimental._
      import scala.language.experimental._
      
      scala> object Macro {
           |   def apply[A](a: A): A = macro impl[A]
           |   def impl[A](c: reflect.macros.Context)(a: c.Expr[A]): c.Expr[A] = a
           | }
      defined module Macro
      
      scala>
      
      scala> class C[T] {
           |   def foo = 0
           | }
      defined class C
      
      scala> implicit def AnyToC[T](a: Any): C[T] = new C[T]
      warning: there were 1 feature warning(s); re-run with -feature for details
      AnyToC: [T](a: Any)C[T]
      
      scala> Macro {
           |   "".foo
           |    ()
           | }
      <console>:17: error: macro has not been expanded
                    Macro {
                    ^
      

        Activity

        Hide
        Jason Zaugg added a comment -

        Already fixed in 2.11.0-M7. Test case and explanation: https://github.com/scala/scala/pull/3172

        Show
        Jason Zaugg added a comment - Already fixed in 2.11.0-M7. Test case and explanation: https://github.com/scala/scala/pull/3172

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Jason Zaugg
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development