fix(library/class_instance_resolution): skip (instance) meta-variables that have been assigned by solving unification constraints

This commit is contained in:
Leonardo de Moura 2015-10-18 16:42:53 -07:00
parent eb2236f036
commit 4787cf179e

View file

@ -1088,6 +1088,13 @@ struct cienv {
lean_assert(!is_done());
unsigned depth = head(m_state.m_stack).first;
expr mvar = head(m_state.m_stack).second;
if (is_assigned(mvar)) {
// Remark: if the metavariable is already assigned, another alternative is to
// execute type class resolution and ensure the synthesized answer is equal to the
// one assigned by solving unification constraints.
m_state.m_stack = tail(m_state.m_stack);
return true; // metavariable was assigned by solving unification constraints
}
if (!mk_choice_point(mvar))
return false;
m_state.m_stack = tail(m_state.m_stack);