Skip to content

Commit 7ab245f

Browse files
authored
Merge pull request #478 from math-comp/fix-error-mising-dep
improve error message missing mixin dep
2 parents 811c9dd + 9d592ee commit 7ab245f

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

HB/common/synthesis.elpi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ instantiate-all-these-mixin-args (fun _ Tm F) T ML R :-
243243
factory-alias->gref TmGR M,
244244
std.mem! ML M,
245245
!,
246-
mixin-for T M X, !,
246+
if (mixin-for T M X) true (coq.error "HB: Unable to find mixin" {nice-gref->string M} "on subject" {coq.term->string T}), !,
247247
instantiate-all-these-mixin-args (F X) T ML R.
248248
instantiate-all-these-mixin-args (fun N Ty F) T ML (fun N Ty FX) :- !,
249249
@pi-decl N Ty m\ instantiate-all-these-mixin-args (F m) T ML (FX m).

Makefile.test-suite.coq.local

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ post-all::
2323
$(call DIFF, tests/howto.v)
2424
$(call DIFF, tests/missing_join_error.v)
2525
$(call DIFF, tests/not_same_key.v)
26-
$(call DIFF, tests/hnf.v)
26+
$(call DIFF, tests/hnf.v)
27+
$(call DIFF, tests/err_miss_dep.v)

tests/err_miss_dep.v

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
From HB Require Import structures.
2+
HB.mixin Record IsAddComoid A := {}.
3+
HB.structure Definition AddComoid := { A of IsAddComoid A }.
4+
HB.mixin Record IsAbelianGrp A of IsAddComoid A := {}.
5+
HB.structure Definition AbelianGrp := { A of IsAbelianGrp A }.
6+
Fail HB.mixin Record IsRing K of IsAbelianGrp K (*& IsAddComoid K*) := {}.

tests/err_miss_dep.v.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The command has indeed failed with message:
2+
HB: Unable to find mixin err_miss_dep_IsAddComoid on subject K

0 commit comments

Comments
 (0)