Skip to content

Update macros doc for tree creation to use blackbox/whitebox context #1710

@nogurenn

Description

@nogurenn

https://docs.scala-lang.org/overviews/reflection/symbols-trees-types.html#tree-creation-via-parse-on-toolboxes

I'm reading about reflection, and running the macros example gives the deprecation warning:

def impl(c: scala.reflect.macros.Context) = c.Expr[Unit](c.parse("println(2)"))
                                 ^
       warning: type Context in package macros is deprecated (since 2.11.0):
                use blackbox.Context or whitebox.Context instead

I thought it makes sense to raise this because of the existence of two different types of Contexts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions