2017-04-22 64 views

回答

0

我如何做到這一點:

//create Param 
val impParam = Term.Param(Nil, Term.Name("id"), Some(Type.Name("String")), Some(Term.Name("default"))) 
//append to existing params seq.`defn` is this method meta object 
val appendImpParam = defn.paramss :+ impParam 

注意:你最好檢查方法有存在隱PARAMS。