Uploaded image for project: '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.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: