I want to know how to create nodes so that they instantiate classes in the code. Currently it's not able to recognize the nodes if I modify the code.
object Test{
def main(args: Array[String]) {
val a= new Avi;
}
}
class Avi{}
class pra{}
In the AST I've created the following node and replaced the ValDef node for the parameter a
val newRhs = Select(New(Ident("pra")),newTermName("<init>"));
retTree = treeCopy.ValDef(vd, mods, name, tpt, newRhs);
I'm getting the following error
error: not found: value pra
I want to know if the way I've created the node is wrong and there is something else I need to do. I passing this retTree in the Transformer class to transform the AST. The type is not being found in the Typer phase of the compiler. Any help will be greatly appreciated.