Parsing a method definition string, don't know how to parse into scala.meta.Decl.Def

112 views Asked by At

I want to be able to parse a string to Decl.Def but the code doesn't compile:

import scala.meta._
val s:String = ... known only at runtime
s.parse[Decl.Def].get

Error:(39, 52) don't know how to parse into scala.meta.Decl.Def

What do I need to do to parse it? Using scalameta 2.0.0

1

There are 1 answers

0
kostas.kougios On

Ok, managed to find the solution: s.parse[Stat]