Skip to content

Commit c10a7f6

Browse files
committed
HB.end: improve error message when no builders are declared
1 parent 9d88e5c commit c10a7f6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

HB/builders.elpi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ begin CtxSkel :-
3131
% "end" is a keyword, be put it in the namespace by hand
3232
func builders.end.
3333
builders.end :- std.do! [
34-
current-mode (builder-from _ _ _ ModName),
34+
current-mode (builder-from T _ _ ModName),
3535

3636
log.coq.env.end-section-name ModName,
3737

@@ -40,8 +40,10 @@ builders.end :- std.do! [
4040
std.fold LFIL [] builders.private.declare-1-builder Clauses,
4141

4242
if (Clauses = [])
43-
(coq.error "No builders to declare, did you forget HB.instance?")
44-
true,
43+
(coq.error "HB:"
44+
{ calc ("No builders on " ^ { coq.term->string T } ^ " to declare.") }
45+
{ calc ("This HB.builders section must HB.instance at least one mixin on " ^ { coq.term->string T } ^ ".") }
46+
) true,
4547

4648
std.findall (abbrev-to-export F_ N_ A_) ExportClauses,
4749
coq.env.current-path CurModPath,

0 commit comments

Comments
 (0)