Type inference # Type equality procedure ## Requirements - Called to indicate that two types (passed as `const ::HIR::TypeRef&` from the HIR) must be the same - Must handle cases where either of the passed typerefs point to aliased inferrence vars ## Rough procedure - Locate real type pointed to by both arguments - If neither have concrete information, alias the right to the left - If both are concrete, ensure that both are equal (recursing for infer) - If only one is concrete, alias the infer to it # Code Elements ## Function/Method references Needs to be able to point to functions in: - Root namespace (with parameters) - Trait (with two sets of parameters) - Type impl block (with two sets of parameters) - NOTE: Don't need to worry about trait impl blocks? - What about handling an associated type return (fully known) Maybe can use separate types for each usecase? # Hard Questions ## libgit2 inferrence quirk Query on rust type inferrence rules (as designed/intended, not as implemented) Can the presence of a trait impl influence type inferrence for the Self type? - `*mut _ : Convert<*mut T>`, if there's only one type that implements that trait, is it valid to infer `_` based on that impl?