Expand description

Specializes generic types to concrete types.

Adapted primarily from the code in MIRAI.

For example:

fn foo<T>(t: T) {}
fn bar<U, V>(u: U, v: V) { foo(u); foo(v); }
fn main() { bar(3, 4.0); }

The function bar is invoked in main with generic arguments [i32, f64]. During analysis, we specialize the types of u and v in bar to i32 and f64 respectively. The calls to foo(u) and foo(v) can therefore be resolved to foo::<i32>(u) and foo::<f64>(v) respectively.

Structs§