fix a missing gc root in codegen
fix 2 ambiguity warnings

fix `TypeVar` dispatch