fix module expand bug

This commit is contained in:
Matthew Flatt 2011-09-20 09:48:48 -06:00
parent 5351d4c7b9
commit a7c607a708
2 changed files with 9 additions and 1 deletions

View File

@ -560,6 +560,14 @@
variable-reference->module-source
(eval (datum->syntax #'here '(#%variable-reference)))))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check handling of unbound names in local-expand:
(err/rt-test (expand '(module m racket
(require racket/require)
(require (filtered-in (lambda (n) foo) scheme))))
exn:fail:contract:variable?)
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -649,7 +649,7 @@ void scheme_register_unbound_toplevel(Scheme_Comp_Env *env, Scheme_Object *id)
void scheme_merge_undefineds(Scheme_Comp_Env *exp_env, Scheme_Comp_Env *env)
{
if (exp_env->prefix->unbound) {
if (exp_env->prefix->unbound && (env->genv->disallow_unbound < 0)) {
/* adding a list to env->prefix->unbound indicates a
phase-1 shift for the identifiers in the list: */
scheme_register_unbound_toplevel(env, exp_env->prefix->unbound);