fix `syntax-local-get-shadower' for submodules

Closes PR 12926, 12928

Merge to v5.3
This commit is contained in:
Matthew Flatt 2012-07-22 21:40:31 -05:00
parent ca360cdaed
commit a0ba30d8e7
4 changed files with 47 additions and 1 deletions

View File

@ -247,6 +247,22 @@
(open-package p5)
q)
;; ----------------------------------------
;; In a submodule
(module package-in-a-submodule racket/base
(require racket/package)
(define-package pkg (foo)
(define foo 5))
(module+ main
(open-package pkg)
(define out foo)
(provide out)))
(test 5 dynamic-require '(submod 'package-in-a-submodule main) 'out)
;; ----------------------------------------
(report-errs)

View File

@ -761,7 +761,6 @@
(provide v)))))
(test 130 dynamic-require `(submod ,path main) 'v))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -714,6 +714,27 @@
(list (signature->symbols s^))
(list (list))))
;; ----------------------------------------
;; In a submodule
(module unit-in-a-submodule racket/base
(require racket/unit)
(define-signature foo^ (f))
(module+ main
(define-unit foo@
(import)
(export foo^)
(define f (lambda (x) x)))
(define-values/invoke-unit/infer foo@)
(define out (f 50))
(provide out)))
(test 50 dynamic-require '(submod 'unit-in-a-submodule main) 'out)
;; --------------------------------------------------
(report-errs)

View File

@ -2232,6 +2232,16 @@ local_module_introduce(int argc, Scheme_Object *argv[])
v = scheme_stx_source_module(s, 0, 0);
if (SCHEME_FALSEP(v)) {
if (env->genv->module
&& env->genv->module->rn_stx
&& SCHEME_VECTORP(env->genv->module->rn_stx)) {
/* This is a submodule, and `rn_stx' has renames for the enclosing modules */
int i;
for (i = SCHEME_VEC_SIZE(env->genv->module->rn_stx); i-- > 1; ) {
v = SCHEME_VEC_ELS(env->genv->module->rn_stx)[i];
s = scheme_add_rename(s, scheme_stx_to_rename(v));
}
}
if (env->genv->rename_set)
s = scheme_add_rename(s, env->genv->rename_set);
if (env->genv->post_ex_rename_set)