expander: fix namespace-require/copy
at phase > 0
This commit is contained in:
parent
f574583907
commit
52f6098de8
|
@ -334,6 +334,16 @@
|
|||
(namespace-require/copy '(for-meta 0 'm) ns)
|
||||
(test 5 eval 'x ns))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Check that `namespace-require/copy` works at compile time
|
||||
|
||||
(let-syntax ([m (lambda (stx)
|
||||
(define ns (make-base-empty-namespace))
|
||||
(parameterize ([current-namespace ns])
|
||||
(namespace-require/copy 'racket/base)
|
||||
#`#,(eval '(+ 1 2))))])
|
||||
(test 3 values (m)))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Check that bulk `require` replaces individual bindings
|
||||
|
||||
|
|
|
@ -471,7 +471,8 @@
|
|||
(define (copy-namespace-value m-ns adjusted-sym binding phase-level phase-shift as-constant?)
|
||||
(define i-ns (namespace->module-namespace m-ns
|
||||
(module-path-index-resolve (module-binding-module binding))
|
||||
(phase- (module-binding-phase binding) phase-level)
|
||||
(phase+ (phase- (module-binding-phase binding) phase-level)
|
||||
phase-shift)
|
||||
#:complain-on-failure? #t))
|
||||
(define val (namespace-get-variable i-ns (module-binding-phase binding) (module-binding-sym binding)
|
||||
(lambda () (error 'namespace-require/copy
|
||||
|
|
|
@ -28684,7 +28684,8 @@ static const char *startup_source =
|
|||
"(let-values(((i-ns_0)"
|
||||
"(let-values(((m-ns335_0) m-ns_0)"
|
||||
"((temp336_0)(1/module-path-index-resolve(module-binding-module binding_0)))"
|
||||
"((temp337_0)(phase-(module-binding-phase binding_0) phase-level_0))"
|
||||
"((temp337_0)"
|
||||
"(phase+(phase-(module-binding-phase binding_0) phase-level_0) phase-shift_0))"
|
||||
"((temp338_0) #t))"
|
||||
"(namespace->module-namespace82.1 #f temp338_0 unsafe-undefined m-ns335_0 temp336_0 temp337_0))))"
|
||||
"(let-values(((val_0)"
|
||||
|
|
Loading…
Reference in New Issue
Block a user