[bindings] Support traits with generic arguments (to support #681)