fix(frontends/lean/inductive_cmd): bug when elaborating inductive tyoe parameters
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
bbff564a1c
commit
5549295c47
2 changed files with 7 additions and 1 deletions
|
@ -259,7 +259,7 @@ struct inductive_cmd_fn {
|
||||||
*/
|
*/
|
||||||
void add_params_to_local_scope(expr d_type, buffer<expr> & params) {
|
void add_params_to_local_scope(expr d_type, buffer<expr> & params) {
|
||||||
for (unsigned i = 0; i < m_num_params; i++) {
|
for (unsigned i = 0; i < m_num_params; i++) {
|
||||||
expr l = mk_local_for(d_type);
|
expr l = mk_local(m_p.mk_fresh_name(), binding_name(d_type), mk_as_is(binding_domain(d_type)), binding_info(d_type));
|
||||||
m_p.add_local(l);
|
m_p.add_local(l);
|
||||||
params.push_back(l);
|
params.push_back(l);
|
||||||
d_type = instantiate(binding_body(d_type), l);
|
d_type = instantiate(binding_body(d_type), l);
|
||||||
|
|
6
tests/lean/run/indbug2.lean
Normal file
6
tests/lean/run/indbug2.lean
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
section
|
||||||
|
parameter {A : Type}
|
||||||
|
definition foo : A → A → Type := (λ x y, Type)
|
||||||
|
inductive bar {a b : A} (f : foo a b) :=
|
||||||
|
bar2 : bar f
|
||||||
|
end
|
Loading…
Reference in a new issue