WIP: better handling of type variables and wildcards