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:
parent
874f67c605
commit
8142726923
1 changed files with 6 additions and 3 deletions
|
@ -119,9 +119,12 @@ class type_inferer::imp {
|
|||
break;
|
||||
}
|
||||
case expr_kind::Var: {
|
||||
context_entry const & ce = lookup(ctx, var_idx(e));
|
||||
if (ce.get_domain())
|
||||
return ce.get_domain();
|
||||
auto p = lookup_ext(ctx, var_idx(e));
|
||||
context_entry const & ce = p.first;
|
||||
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
|
||||
// available is not considered cheap.
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue