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

Macros don't provide _this when declared inside an object

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0
    • Fix Version/s: Scala 2.10.0-M1, Scala 2.10.0
    • Component/s: Macros
    • Labels:
      None

      Description

      object Foo extends App {
        def macro bar() = Apply(Select(_this, newTermName("quux")), List(List()))
        def quux() = println("o hai")
      }
      
      D:\Dropbox\Scratchpad\Scala>scalac -Xmacros Macros.scala
      Macros.scala:2: error: not found: value _this
        def macro bar() = Apply(Select(_this, newTermName("quux")), List(List()))
                                       ^
      one error found
      

        Activity

        Show
        Eugene Burmako added a comment - Fixed by https://github.com/scala/scala/commit/2fc92eb4f0ab8f12b4ed6c2439ef9a53484b3e45

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development