Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependent evars line with defined evars #18991

Merged
merged 1 commit into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion printing/printer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,9 @@ let process_dependent_evar q acc evm is_dependent e =
let () = match Evd.evar_body evi with
| Evar_empty ->
queue_term q true (Evd.evar_concl evi)
| Evar_defined b -> ()
| Evar_defined b ->
let env = Evd.evar_filtered_env (Global.env ()) evi in
queue_term q true (Retyping.get_type_of env evm b)
in
List.iter begin fun decl ->
let open NamedDecl in
Expand Down
41 changes: 41 additions & 0 deletions test-suite/output-coqtop/DependentEvars3.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

Coq <
Coq < 1 goal

============================
(exists n : nat, n = 5 \/ True) /\ (exists m : nat, m = 6 \/ True)

(dependent evars: ; in current goal:)

x <
x < 2 goals

============================
exists n : nat, n = 5 \/ True

goal 2 is:
exists m : nat, m = 6 \/ True

(dependent evars: ; in current goal:)

x < 2 focused goals (shelved: 1)

============================
?n = 5 \/ True

goal 2 is:
exists m : nat, m = 6 \/ True

(dependent evars: ?X10:?n; in current goal: ?X10)

x < 2 focused goals (shelved: 1)

============================
True

goal 2 is:
exists m : nat, m = 6 \/ True

(dependent evars: ?X10:?n; in current goal:)

x <
6 changes: 6 additions & 0 deletions test-suite/output-coqtop/DependentEvars3.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Set Printing Dependent Evars Line.
Lemma x : (exists(n : nat), n = 5 \/ True) /\ (exists(m : nat), m = 6 \/ True).
Proof using.
split.
eexists.
right.