rust-lang / a-mir-formality

a model of MIR and the Rust type/trait system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type-checking calls in the MIR

nikomatsakis opened this issue · comments

Type-checking calls: when there is a CALL in the MIR, we need to "unpack" the fn type to get to something callable. e.g. if the type of the thing-to-be-called is forall<'a> (T => F), then we should instantiate 'a with an inference variable, add T as an obligation, and finally get the signature from F.

The callable thing should be either a fn-def type or a fn-ptr type.

We need to work out trait calls at some point too.