fix errortrace for phase N outside of module

This commit is contained in:
Matthew Flatt 2011-11-07 12:59:07 -07:00
parent af3019fa5a
commit 7d607fdd93
3 changed files with 22 additions and 2 deletions

View File

@ -426,7 +426,11 @@
body ...) body ...)
#'mb))))))])])))] #'mb))))))])])))]
[_else [_else
(normal top-e)]))) (let ([e (normal top-e)])
(let ([meta-depth ((count-meta-levels 0) e)])
#`(begin
#,(generate-key-imports meta-depth)
#,e)))])))
(define-namespace-anchor orig-namespace) (define-namespace-anchor orig-namespace)

View File

@ -1,7 +1,12 @@
#lang racket/base #lang racket/base
(require tests/eli-tester "wrap.rkt" "alert.rkt") (require tests/eli-tester
"wrap.rkt"
"alert.rkt"
"phase-1.rkt")
(wrap-tests) (wrap-tests)
(test do (alert-tests)) (test do (alert-tests))
(phase-1-tests)

View File

@ -0,0 +1,11 @@
#lang racket/base
(provide phase-1-tests)
;; Check that phase-1 annotations work, even in a namespace that is
;; otherwise empty at phase 1.
(define (phase-1-tests)
(define ns (make-base-namespace))
(parameterize ([current-namespace ns])
(dynamic-require 'errortrace #f)
(eval #'(struct a (x)))))