
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
19 lines
328 B
Racket
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))
|