bugfixes #66

Merged
pkulev merged 43 commits from bugfixes into main 2026-10-19 21:14:40 +02:00
Showing only changes of commit 64db505e6b - Show all commits

View File

@@ -290,10 +290,23 @@
(let ((path (locate-module (symbol->string (car modules)))))
(if (or (not path) (member path seen))
(next (cdr modules) seen acc)
(let ((forms (interface-forms (read-module path))))
(next (append (cdr modules) (imported-modules forms #f))
(let ((exports (module-exports path)))
(next (append (cdr modules) (cdr exports))
(cons path seen)
(cons (declared-types forms) acc))))))))
(cons (car exports) acc))))))))
;;; The types the module at PATH declares to its importers, and the
;;; modules its interface imports; worked out once, though the check of
;;; every module above it on a pub import chain walks there
(define +module-exports+ (list))
(define (module-exports path)
(cond ((assoc path +module-exports+) => cdr)
(else (let* ((forms (interface-forms (read-module path)))
(exports (cons (declared-types forms)
(imported-modules forms #f))))
(set! +module-exports+ (cons (cons path exports) +module-exports+))
exports))))
(define (public-fn-interface raw-form)
;; (pub fn name args ret . body) -> prototype, keeping a docstring so