fix nested begin-for-syntax

Initialize a phase-2 namespace before trying to use it.
This commit is contained in:
Matthew Flatt 2015-07-19 12:07:53 -06:00
parent 9fe6c138cf
commit 0bc5a1b06a
2 changed files with 11 additions and 2 deletions

View File

@ -1495,6 +1495,14 @@ case of module-leve bindings; it doesn't cover local bindings.
(begin-for-syntax
(local-require (only-in racket [+ ++]))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Try trivial nested `begin-for-syntax`,
;; avoiding anything else that might prepare phase 2 in advance
(module starts-phase-2-without-any-content racket
(begin-for-syntax
(begin-for-syntax)))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -8968,10 +8968,11 @@ static Scheme_Object *do_module_begin_at_phase(Scheme_Object *form, Scheme_Comp_
SCHEME_EXPAND_OBSERVE_PREPARE_ENV(observer);
frame_scopes = scheme_module_context_use_site_frame_scopes(env->genv->exp_env->stx_context);
scheme_prepare_exp_env(env->genv);
scheme_prepare_compile_env(env->genv->exp_env);
frame_scopes = scheme_module_context_use_site_frame_scopes(env->genv->exp_env->stx_context);
eenv = scheme_new_comp_env(env->genv->exp_env, env->insp,
frame_scopes,
0);