fix(type_inferer): bug when inferring the type of free variables

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-10-22 15:41:22 -07:00
parent 874f67c605
commit 8142726923

View file

@ -119,9 +119,12 @@ class type_inferer::imp {
break; break;
} }
case expr_kind::Var: { case expr_kind::Var: {
context_entry const & ce = lookup(ctx, var_idx(e)); auto p = lookup_ext(ctx, var_idx(e));
if (ce.get_domain()) context_entry const & ce = p.first;
return ce.get_domain(); if (ce.get_domain()) {
context const & ce_ctx = p.second;
return lift_free_vars(ce.get_domain(), ctx.size() - ce_ctx.size());
}
// Remark: the case where ce.get_domain() is not // Remark: the case where ce.get_domain() is not
// available is not considered cheap. // available is not considered cheap.
break; break;