1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +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) (let ((b (lambda (a sym definep)
(false-if-exception (false-if-exception
(and (memq sym bindings) (and (memq sym bindings)
(let ((i (module-public-interface (resolve-module name)))) (let ((i (resolve-interface name #:select bindings)))
(if (not i) (unless i
(error "missing interface for module" name)) (error "missing interface for module" name))
(let ((autoload (memq a (module-uses module)))) (let ((uses (memq a (module-uses module))))
;; Replace autoload-interface with actual interface if (when uses
;; that has not happened yet. ;; Replace autoload-interface with actual
(if (pair? autoload) ;; interface.
(set-car! autoload i))) (set-car! uses i)))
(module-local-variable i sym))) (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)))) #:warning "Failed to autoload ~a in ~a:\n" sym name))))
(module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f (module-constructor (make-hash-table 0) '() b #f #f name 'autoload #f
(make-hash-table 0) '() (make-weak-value-hash-table) #f (make-hash-table 0) '() (make-weak-value-hash-table) #f