diff options
| author | coqbot-app[bot] | 2020-11-10 08:56:50 +0000 |
|---|---|---|
| committer | GitHub | 2020-11-10 08:56:50 +0000 |
| commit | 2676541296bf1650be1a34f17e95f973b54ab715 (patch) | |
| tree | f2237237169670e9d25a9d5c3674881858cb1e4f | |
| parent | 449aef5dea7314f3bf4311380aa10c5cf0c3a158 (diff) | |
| parent | b1cb26eed7bdde340aeacf23e1bc461eb06c4ddd (diff) | |
Merge PR #13322: [obligation] Properly handle no obligations on `Next Obligation`
Reviewed-by: SkySkimmer
| -rw-r--r-- | test-suite/output/bug_13320.out | 2 | ||||
| -rw-r--r-- | test-suite/output/bug_13320.v | 2 | ||||
| -rw-r--r-- | vernac/declare.ml | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/test-suite/output/bug_13320.out b/test-suite/output/bug_13320.out new file mode 100644 index 0000000000..97efe1da87 --- /dev/null +++ b/test-suite/output/bug_13320.out @@ -0,0 +1,2 @@ +The command has indeed failed with message: +No obligations remaining diff --git a/test-suite/output/bug_13320.v b/test-suite/output/bug_13320.v new file mode 100644 index 0000000000..6f3c51bbe7 --- /dev/null +++ b/test-suite/output/bug_13320.v @@ -0,0 +1,2 @@ +(* Next Obligation should fail normally, not with an anomaly. *) +Fail Next Obligation. 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 |
