Generics: return variable subclass using `go.type_assert(X, self)` to cast to subclass type.
TODO: do not include super class in generic type switch, and gather all classes and subclasses before doing main translation (to generate the generic switch properly)