fix(library/class_instance_resolution): skip (instance) meta-variables that have been assigned by solving unification constraints
This commit is contained in:
parent
eb2236f036
commit
4787cf179e
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue