report a module's macro call failing for other than its own names
All checks were successful
Sex CI / build-linux (pull_request) Successful in 5m38s
Sex CI / build-linux (push) Successful in 5m33s

Reading a module's interface dropped any toplevel call that raised, not
only one asking after a declaration of the module's, which no importer
has yet. Lookups now tell which names they missed, and only those failures
give importers nothing.
This commit was merged in pull request #72.
This commit is contained in:
2026-10-27 22:41:06 +03:00
parent d890080103
commit 724f4dd3e9
4 changed files with 64 additions and 14 deletions

View File

@@ -38,6 +38,7 @@
;;;
;;; gen/made writes its pub forms by macro calls, which are expanded when
;;; its interface is read; the macros it used for that stay its own.
;;; gen/broken's call raises, which reading its interface reports.
;;;
;;; make check-modules
@@ -138,6 +139,12 @@
'("made 42 7 1 2")
(output-of (built "made-app")))
;;; ...but a call failing for other than a name its module declares fails
;;; there as well
(test-assert "a toplevel macro call that raises fails the interface too"
(let ((err (error-of sexc "--public-interface" "gen/broken.sex")))
(and err (irregex-search "broken\\.sex:8: expanding boom: nope" err))))
;;; ...while a realization of a spec importers cannot see is refused by
;;; the module that writes it, not by an importer naming it first
(test-assert "a pub realization of a spec imported without pub is refused"

View File

@@ -0,0 +1,8 @@
;;; A toplevel macro call failing for what it is, not for asking after a
;;; name declared here: an importer is told so, as this module is
(defmacro (boom)
(error "nope"))
(pub fn fine () int (return 1))
(boom)