expander: repair for module with (#%declare #:empty-namespace)
Repair a corner of `namespace-attach-module` on modules that include `(#%declare #:empty-namespace)`.
This commit is contained in:
parent
1ee5786e2d
commit
ab7dffa420
|
@ -2582,6 +2582,20 @@ case of module-leve bindings; it doesn't cover local bindings.
|
|||
|
||||
(dynamic-require '(submod 'm-use main) #f))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Make sure that a module can be attached without a recorded namespace syntax context
|
||||
|
||||
(eval
|
||||
(let ([o (open-output-bytes)])
|
||||
(write (compile
|
||||
'(module please-attach-me-successfully racket/kernel
|
||||
(#%declare #:empty-namespace)))
|
||||
o)
|
||||
(parameterize ([read-accept-compiled #t])
|
||||
(read (open-input-bytes (get-output-bytes o))))))
|
||||
|
||||
(namespace-attach-module-declaration (current-namespace) ''please-attach-me-successfully (make-base-namespace))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -247,9 +247,7 @@
|
|||
syntax-literals-linklet data-instance syntax-literals-data-instance
|
||||
phase-shift original-self self bulk-binding-registry insp
|
||||
create-root-expand-context-from-module)
|
||||
(when (and (not (load-on-demand-enabled))
|
||||
(not (eq? syntax-literals-data-instance empty-syntax-literals-data-instance))
|
||||
(not (eq? syntax-literals-data-instance empty-syntax-literals-instance/empty-namespace)))
|
||||
(when (not (load-on-demand-enabled))
|
||||
(force-syntax-deserialize syntax-literals-data-instance bulk-binding-registry))
|
||||
|
||||
(define inst
|
||||
|
@ -296,12 +294,14 @@
|
|||
;; ----------------------------------------
|
||||
|
||||
(define (force-syntax-deserialize syntax-literals-data-instance bulk-binding-registry)
|
||||
(unless (or (eq? syntax-literals-data-instance empty-syntax-literals-data-instance)
|
||||
(eq? syntax-literals-data-instance empty-syntax-literals-instance/empty-namespace))
|
||||
;; Since on-demand loading is disabled, force deserialization
|
||||
(let ([deserialize-syntax (instance-variable-value syntax-literals-data-instance deserialize-syntax-id)])
|
||||
;; We need to make sure there's something to deserialize; if it's already done
|
||||
;; `deserialize-syntax` has been set to #f
|
||||
(when deserialize-syntax
|
||||
(deserialize-syntax bulk-binding-registry))))
|
||||
(deserialize-syntax bulk-binding-registry)))))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user