typed-racket/typed-racket-test/succeed/gh-issue-163-1.rkt
Asumu Takikawa 241f04bcdb Fix typed provide uses in some modules
When identifiers provided by typed modules were used in
certain submodules of the form (module* n #f ...) or were
used by modules implemented in a language defined by TR,
the wrong redirection was used in the expansion.

The reason was because TR's identifier redirection decided
whether it was in a typed or untyped context at module visit
time, but that's too early in the cases above.

(because TR's #%module-begin may not have begun expanding yet)

The fix uses a rename-transformer that delays the decision
to use the typed or untyped identifier until expansion time.

Closes GH issue #163 and #181

Closes PR 15118
2015-09-08 15:53:34 -04:00

19 lines
328 B
Racket

#lang typed/racket
;; Test for GH issue 163
(: bar (case→ ( 'a True) ( 'b False)))
(define (bar x) (if (eq? x 'a) #t #f))
(module m typed/racket
(: foo (case→ ( 'a True) ( 'b False)))
(define (foo x) (if (eq? x 'a) #t #f))
(provide foo))
(require 'm)
(module+ test
(define b bar)
(define f foo))