fix(library/definitional/no_confusion): assertion violation
This commit is contained in:
parent
95554a527c
commit
363d4a7577
2 changed files with 16 additions and 0 deletions
|
@ -27,6 +27,8 @@ optional<environment> mk_no_confusion_type(environment const & env, name const &
|
||||||
declaration ind_decl = env.get(n);
|
declaration ind_decl = env.get(n);
|
||||||
declaration cases_decl = env.get(name(n, "cases_on"));
|
declaration cases_decl = env.get(name(n, "cases_on"));
|
||||||
level_param_names lps = cases_decl.get_univ_params();
|
level_param_names lps = cases_decl.get_univ_params();
|
||||||
|
if (is_nil(lps))
|
||||||
|
return optional<environment>(); // type is a proposition
|
||||||
level rlvl = mk_param_univ(head(lps));
|
level rlvl = mk_param_univ(head(lps));
|
||||||
levels ilvls = param_names_to_levels(tail(lps));
|
levels ilvls = param_names_to_levels(tail(lps));
|
||||||
if (length(ilvls) != length(ind_decl.get_univ_params()))
|
if (length(ilvls) != length(ind_decl.get_univ_params()))
|
||||||
|
|
14
tests/lean/run/no_confusion_bug.lean
Normal file
14
tests/lean/run/no_confusion_bug.lean
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
import data.nat.basic
|
||||||
|
open nat
|
||||||
|
|
||||||
|
inductive fin : nat → Type :=
|
||||||
|
fz : Π {n : nat}, fin (succ n),
|
||||||
|
fs : Π {n : nat}, fin n → fin (succ n)
|
||||||
|
|
||||||
|
namespace fin
|
||||||
|
|
||||||
|
inductive le : ∀ {n : nat}, fin n → fin n → Prop :=
|
||||||
|
lez : ∀ {n : nat} (j : fin (succ n)), le fz j,
|
||||||
|
les : ∀ {n : nat} {i j : fin n}, le i j → le (fs i) (fs j)
|
||||||
|
|
||||||
|
end fin
|
Loading…
Reference in a new issue