From 807b909e737c7417773a06f29ae5fe923aa61537 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 30 Jul 2014 06:27:06 +0100 Subject: [PATCH] allow `expand` on cross-phase-persistent modules Previoulsy, `expand` mode explicitly disallowed cross-phase declaration in commit 2e652fc2b3. I'm not sure why, and that commit has no test case that fails when the restriction is removed, so my best guess is that it was a debugging strategy that I forgot to undo. --- pkgs/racket-pkgs/racket-test/tests/racket/cross-phase.rkt | 8 ++++++++ racket/src/racket/src/module.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/racket-pkgs/racket-test/tests/racket/cross-phase.rkt b/pkgs/racket-pkgs/racket-test/tests/racket/cross-phase.rkt index e3ce2a0f99..8858ceabbe 100644 --- a/pkgs/racket-pkgs/racket-test/tests/racket/cross-phase.rkt +++ b/pkgs/racket-pkgs/racket-test/tests/racket/cross-phase.rkt @@ -108,5 +108,13 @@ 'ok)) (error 'cross-phase "redeclaration should have been disallowed")))) +;; Check that `expand` allows cross-phase modules: +(parameterize ([current-namespace (make-base-namespace)]) + (void + (expand (datum->syntax + #f + '(module m '#%kernel + (#%declare #:cross-phase-persistent)))))) + (displayln "All tests passed.") diff --git a/racket/src/racket/src/module.c b/racket/src/racket/src/module.c index deaa4d6a5d..d76bd0108b 100644 --- a/racket/src/racket/src/module.c +++ b/racket/src/racket/src/module.c @@ -7390,7 +7390,7 @@ static Scheme_Object *do_module(Scheme_Object *form, Scheme_Comp_Env *env, m->tt_requires = scheme_null; m->dt_requires = scheme_null; - if (iim && iim->phaseless && rec[drec].comp) + if (iim && iim->phaseless) m->phaseless = scheme_true; if (iidx) {