fix(frontends/lean/structure_cmd): when error recovery is enabled, we must not assume the expression in the fixed line is a binding expression (it may be a sorry expression)

This commit is contained in:
Leonardo de Moura 2017-02-20 14:51:59 -08:00
parent ddee94b831
commit 61254847fb

View file

@ -323,6 +323,8 @@ struct structure_cmd_fn {
*/
expr update_locals(expr new_tmp, buffer<expr> & locals) {
for (unsigned i = 0; i < locals.size(); i++) {
if (!is_binding(new_tmp))
throw exception("structure command elaboration was interrupted due to nested errors");
expr new_local = mk_local(mlocal_name(locals[i]), binding_name(new_tmp), binding_domain(new_tmp),
binding_info(new_tmp));
locals[i] = new_local;