move contract submodules to start of enclosing module

Putting the contract submodules early enough allows them to be used
for `module*` submodules.

Repairs a problem reported by Alexander:
 http://lists.racket-lang.org/users/archive/2015-March/066164.html
This commit is contained in:
Matthew Flatt 2015-03-02 17:36:22 -07:00 committed by Sam Tobin-Hochstadt
parent 4866ff825b
commit 011649a654
2 changed files with 10 additions and 4 deletions

View File

@ -420,8 +420,8 @@
(match-define (list from to) a)
#`(add-alias (quote-syntax #,from) (quote-syntax #,to))))))
(begin-for-syntax (add-mod! (variable-reference->module-path-index
(#%variable-reference)))))
#`(begin
(#%variable-reference))))
;; FIXME: share this variable reference with the one below
(define the-variable-reference (quote-module-name))
;; Here we construct the redirector for the #%contract-defs
@ -471,8 +471,8 @@
(module* #%contract-defs #f
(#%plain-module-begin
#,extra-requires
new-defs ...))
new-defs ...)))
#`(begin
;; Now we create definitions that are actually provided
;; from the module itself. There are two levels of
;; indirection here (see the implementation in

View File

@ -0,0 +1,6 @@
#lang typed/racket/base
(provide x)
(define x : Integer 1)
(module* test racket/base
(require (submod ".."))
x)