expander: fix namespace-require/copy
This commit is contained in:
parent
0d06ba2848
commit
3f2fd06cb0
|
@ -307,6 +307,16 @@
|
|||
(namespace-require/constant 'racket/base)
|
||||
(err/rt-test (eval '(define + -)) #rx"cannot change constant"))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Check that `namespace-require/copy` does define variables
|
||||
;; but doesn't bind as required
|
||||
|
||||
(parameterize ([current-namespace (make-base-empty-namespace)])
|
||||
(namespace-require/copy 'racket/base)
|
||||
(test (void) eval '(void))
|
||||
(test #f identifier-binding (namespace-syntax-introduce (datum->syntax #f 'void)))
|
||||
(test #t list? (identifier-binding (namespace-syntax-introduce (datum->syntax #f 'lambda)))))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Check that bulk `require` replaces individual bindings
|
||||
|
||||
|
|
|
@ -343,11 +343,10 @@
|
|||
#:as-transformer? as-transformer?))
|
||||
skip-bind?]
|
||||
[else #f]))
|
||||
(when (and adjusted-sym
|
||||
copy-variable-phase-level
|
||||
(when (and copy-variable-phase-level
|
||||
(not as-transformer?)
|
||||
(equal? provide-phase copy-variable-phase-level))
|
||||
(copy-namespace-value m-ns adjusted-sym binding copy-variable-phase-level phase-shift
|
||||
(copy-namespace-value m-ns sym binding copy-variable-phase-level phase-shift
|
||||
copy-variable-as-constant?))
|
||||
(and (not skip-bind?) adjusted-sym))))
|
||||
;; Now that a bulk binding is in place, update to merge nominals:
|
||||
|
|
|
@ -25310,8 +25310,7 @@ static const char *startup_source =
|
|||
"(let-values()"
|
||||
" #f))))"
|
||||
"(begin"
|
||||
"(if(if adjusted-sym_0"
|
||||
"(if copy-variable-phase-level_1"
|
||||
"(if(if copy-variable-phase-level_1"
|
||||
"(if(not"
|
||||
" as-transformer?_3)"
|
||||
"(equal?"
|
||||
|
@ -25319,11 +25318,10 @@ static const char *startup_source =
|
|||
" copy-variable-phase-level_1)"
|
||||
" #f)"
|
||||
" #f)"
|
||||
" #f)"
|
||||
"(let-values()"
|
||||
"(copy-namespace-value"
|
||||
" m-ns_10"
|
||||
" adjusted-sym_0"
|
||||
" sym_42"
|
||||
" binding_16"
|
||||
" copy-variable-phase-level_1"
|
||||
" phase-shift_11"
|
||||
|
|
Loading…
Reference in New Issue
Block a user