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

Context.enclosingApplication always returns EmptyTree

    Details

      Description

      Given the following macro definition

        def mkInt = macro mkIntImpl
        def mkIntImpl(c: Context): c.Expr[Any] = {
          println(c.enclosingApplication)
          c.reify{ 23 }
        }
      

      I would expect something other than EmptyTree to be returned in the body of the macro when applied like so,

      val i1 = mkInt
      val i2 = identity(mkInt)
      

      However in both cases the result is EmptyTree.

        Activity

        Hide
        Philipp Haller added a comment -

        Test file in pending/run (see pull request #485.

        Show
        Philipp Haller added a comment - Test file in pending/run (see pull request #485.
        Show
        Adriaan Moors added a comment - https://github.com/scala/scala/pull/935

          People

          • Assignee:
            Eugene Burmako
            Reporter:
            Miles Sabin
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development