I think the way I want to handle this is a two-step process: first infer and fill in variables, then unfiy in a separate step. Storing the data in the AST is handy.