Has the equivalent of scala.reflect.macros.Parsers been removed? #12500
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In Scala2's macro, I could dynamically construct expressions by using Context.parse and so on. defgenerateExpr[T: c.WeakTypeTag](target: C#Symbol):C#Expr[T] ={if (target.isModule){c.Expr[T](c.parse(target.fullName)) } else{c.Expr[T]{c.parse( s"""new ${target.fullName}(${vala= target.asClass.primaryConstructor.asMethod valb= a.paramLists target.asClass.primaryConstructor.asMethod.paramLists .collect{case curry if!curry.exists(_.isImplicit) => curry.map{param =>s"inject[${param.typeSignature.toString}]" }.mkString(",") } .mkString(")(") }) with MixIn""" ) } } }I was able to expand the TypeSignature into a Quasiquotes. It is not easy to define an EXpression that takes |
BetaWas this translation helpful?Give feedback.
Replies: 1 comment 1 reply
-
|
BetaWas this translation helpful?Give feedback.
https://contributors.scala-lang.org/t/compatibility-required-for-migration-from-scala2-macro/5100/2?u=giiita