From b1cb26eed7bdde340aeacf23e1bc461eb06c4ddd Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Sat, 7 Nov 2020 23:14:53 +0100 Subject: [obligation] Proper handle no obligations on `Next Obligation` Fixes #13320 . Trivial programming error, actually this is handled better in a further refactoring branch not submitted due to the long time the whole rework took. --- vernac/declare.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vernac') diff --git a/vernac/declare.ml b/vernac/declare.ml index 0baae6eca5..367d0bf944 100644 --- a/vernac/declare.ml +++ b/vernac/declare.ml @@ -2499,7 +2499,12 @@ let admit_obligations ~pm n = let next_obligation ~pm n tac = let prg = match n with - | None -> State.first_pending pm |> Option.get + | None -> + begin match State.first_pending pm with + | Some prg -> prg + | None -> + Error.no_obligations None + end | Some _ -> get_unique_prog ~pm n in let {obls; remaining} = Internal.get_obligations prg in -- cgit v1.2.3