fix generic typing for c.tree builder