forked from alex-eg/sex
report a module's macro call failing for other than its own names
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 is contained in:
@@ -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"
|
||||
|
||||
8
tests/modules/gen/broken.sex
Normal file
8
tests/modules/gen/broken.sex
Normal 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)
|
||||
Reference in New Issue
Block a user