Polymorphic classes are defined using withTypeParams(...)
:
scala> import treehugger.forest._, definitions._, treehuggerDSL._
import treehugger.forest._
import definitions._
import treehuggerDSL._
scala> val tree = (CLASSDEF("Queue") withTypeParams(TYPEVAR("A"))
withParams(VAL("leading", "A"), VAL("trailing", "A")): Tree)
[1m[34mtree[0m: [1m[32mtreehugger.forest.Tree[0m = ClassDef(Modifiers(, , Map()),Modifiers(, , Map()),Queue,List(TypeDef(Modifiers(, , Map()),A,List(),EmptyTree)),List(ValDef(Modifiers(, , Map()),Typed(Ident(leading),TypeTree()),EmptyTree), ValDef(Modifiers(, , Map()),Typed(Ident(trailing),TypeTree()),EmptyTree)),Template(List(),ValDef(Modifiers(private, , Map()),Ident(_),EmptyTree),List()))
scala> treeToString(tree)
[1m[34mres0[0m: [1m[32mString[0m = class Queue[A](val leading: A, val trailing: A)