mercredi 4 février 2015

Scala quasiquotes and class instance reified

Let



case class C(var tag: String = "")


and a tree from quasiquoting val a = C()



val x = q" val a = C() "
x: reflect.runtime.universe.ValDef = val a = C()


Given that



x.name.toString
String = a


how to set a.tag = x.name.toString so that



assert ( a.tag = "a" )





Aucun commentaire:

Enregistrer un commentaire