fix(library/type_context): prevent assertion violation

This commit is contained in:
Leonardo de Moura 2016-08-03 18:43:55 -07:00
parent b79a8ddd25
commit e9d2d51760

View file

@ -411,10 +411,12 @@ expr type_context::whnf_core(expr const & e) {
/* Remark: we do not unfold Constants eagerly in this method */
return e;
case expr_kind::Local:
if (auto d = m_lctx.get_local_decl(e)) {
if (auto v = d->get_value()) {
/* zeta-reduction */
return whnf_core(*v);
if (is_local_decl_ref(e)) {
if (auto d = m_lctx.get_local_decl(e)) {
if (auto v = d->get_value()) {
/* zeta-reduction */
return whnf_core(*v);
}
}
}
return e;