fix(kernel/type_checker): preserve bound variable name when inferring type of a lambda expression
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
63b6564b78
commit
6b05146eca
1 changed files with 2 additions and 1 deletions
|
@ -19,6 +19,7 @@ Author: Leonardo de Moura
|
||||||
#include "kernel/abstract.h"
|
#include "kernel/abstract.h"
|
||||||
|
|
||||||
namespace lean {
|
namespace lean {
|
||||||
|
|
||||||
/** \brief Auxiliary functional object used to implement type checker. */
|
/** \brief Auxiliary functional object used to implement type checker. */
|
||||||
struct type_checker::imp {
|
struct type_checker::imp {
|
||||||
environment m_env;
|
environment m_env;
|
||||||
|
@ -682,7 +683,7 @@ struct type_checker::imp {
|
||||||
ensure_sort(t, binder_domain(e));
|
ensure_sort(t, binder_domain(e));
|
||||||
}
|
}
|
||||||
auto b = open_binder_body(e);
|
auto b = open_binder_body(e);
|
||||||
r = Pi(b.second, binder_domain(e), infer_type_core(b.first, infer_only));
|
r = mk_pi(binder_name(e), binder_domain(e), abstract_p(infer_type_core(b.first, infer_only), b.second));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case expr_kind::Pi: {
|
case expr_kind::Pi: {
|
||||||
|
|
Loading…
Reference in a new issue