Scala Macros: Accessing members with quasiquotes

后端 未结 2 611
没有蜡笔的小新
没有蜡笔的小新 2021-02-04 18:31

I\'m trying to implement an implicit materializer as described here: http://docs.scala-lang.org/overviews/macros/implicits.html

I decided to create a macro that converts

2条回答
  •  甜味超标
    2021-02-04 18:47

    The field you get with accessed.name has a special suffix attached to it, to avoid naming conflicts.

    The special suffix is scala.reflect.api.StandardNames$TermNamesApi.LOCAL_SUFFIX_STRING, which has the value, you guessed it, a space char.

    This is quite evil, of course.

提交回复
热议问题