fix(library/type_context): make sure code doesn't fail if local decl does not exist
This commit is contained in:
parent
db5d0d52c5
commit
695bba6291
1 changed files with 5 additions and 4 deletions
|
|
@ -209,10 +209,11 @@ type_context::~type_context() {
|
|||
|
||||
name type_context::get_local_pp_name(expr const & e) const {
|
||||
lean_assert(is_local(e));
|
||||
if (is_local_decl_ref(e))
|
||||
return m_lctx.get_local_decl(e)->get_pp_name();
|
||||
else
|
||||
return local_pp_name(e);
|
||||
if (is_local_decl_ref(e)) {
|
||||
if (auto d = m_lctx.get_local_decl(e))
|
||||
return d->get_pp_name();
|
||||
}
|
||||
return local_pp_name(e);
|
||||
}
|
||||
|
||||
expr type_context::push_local(name const & pp_name, expr const & type, binder_info const & bi) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue