Utility for extracting type parameters

Florian Weimer fweimer at bfk.de
Fri Sep 30 01:22:01 PDT 2011


I've got a type T (in the most general sense; that is, it can be a
generic type with or with type parameters applied) and a generic type X
such that T is assignable to X.  If no raw types are involved and I'm
not mistaken, the type parameters of X which make this assignment valid
are uniquely determined.  Is there a helper function to compute them?

At first glance, this does not seem to be too difficult to compute, but
generics are tricky, so I wonder if there's existing code.

-- 
Florian Weimer                <fweimer at bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99



More information about the compiler-dev mailing list