Skip to content

Commit

Permalink
expander: repair attach of module with a for-label import
Browse files Browse the repository at this point in the history
Fixes a bug in a847564.
  • Loading branch information
mflatt committed May 13, 2024
1 parent a847564 commit 42f75b9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
8 changes: 8 additions & 0 deletions pkgs/racket-test-core/tests/racket/module.rktl
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,14 @@
;; is correctly attached as instantiated in this namespace
(eval stx))))

(module uses-m-at-label-phase racket/base
(require (for-label 'provides-variable-m-at-phase-1)))
(test #t void? (dynamic-require ''uses-m-at-label-phase #f))
(let ([orig (current-namespace)])
(parameterize ([current-namespace (make-base-namespace)])
(namespace-attach-module orig ''uses-m-at-label-phase)))


;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check redundant import and re-provide

Expand Down
6 changes: 5 additions & 1 deletion racket/src/bc/src/startup.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions racket/src/cs/schemified/expander.scm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion racket/src/expander/namespace/module.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,8 @@
((module-force-bulk-binding m) (namespace-bulk-binding-registry ns)))

(define (module-instantiates-at-level? m phase-level)
(<= (module-min-phase-level m) phase-level (module-max-phase-level m)))
(and (not (label-phase? phase-level))
(<= (module-min-phase-level m) phase-level (module-max-phase-level m))))

;; ----------------------------------------

Expand Down

0 comments on commit 42f75b9

Please sign in to comment.