1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Propagate replacement flag for autoload interfaces

* module/ice-9/boot-9.scm (make-autoload-interface): Propagate replaced
  binding flags to autoload interface.
This commit is contained in:
Andy Wingo 2019-12-05 14:05:51 +01:00
parent 0f61d8d797
commit cb14fd2143

View file

@ -3415,15 +3415,21 @@ error if selected binding does not exist in the used module."
(let ((b (lambda (a sym definep)
(false-if-exception
(and (memq sym bindings)
(let ((i (module-public-interface (resolve-module name))))
(if (not i)
(error "missing interface for module" name))
(let ((autoload (memq a (module-uses module))))
;; Replace autoload-interface with actual interface if
;; that has not happened yet.
(if (pair? autoload)
(set-car! autoload i)))
(module-local-variable i sym)))
(let ((i (resolve-interface name #:select bindings)))
(unless i
(error "missing interface for module" name))
(let ((uses (memq a (module-uses module))))
(when uses
;; Replace autoload-interface with actual
;; interface.
(set-car! uses i)))
(for-each
(lambda (name)
(when (hashq-ref (module-replacements i) name)
(hashq-set! (module-replacements a) name #t)))
bindings)
(or (module-local-variable i sym)
(error "binding not presentin module" name sym))))
#:warning "Failed to autoload ~a in ~a:\n" sym name))))
(module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f
(make-hash-table 0) '() (make-weak-value-hash-table) #f