Fix unsafe-require/typed for kw functions

This commit is contained in:
Asumu Takikawa 2015-10-16 14:59:24 -04:00
parent 3d91ebeb4c
commit 638618ae40
2 changed files with 13 additions and 2 deletions

View File

@ -193,11 +193,15 @@
#,(internal #'(require/typed-internal hidden ty . sm))
#,(ignore #`(require/contract nm.spec hidden #,cnt* lib))))]
[else
(define/with-syntax hidden2 (generate-temporary #'nm.nm))
(quasisyntax/loc stx
(begin
(require (only-in lib [nm.orig-nm hidden]))
(rename-without-provide nm.nm hidden)
#,(internal #'(require/typed-internal hidden ty . sm))))])]))
;; need this indirection since `hidden` may expand
;; to a different identifier that TR doesn't know about
#,(ignore #'(define hidden2 hidden))
(rename-without-provide nm.nm hidden2)
#,(internal #'(require/typed-internal hidden2 ty . sm))))])]))
(values (r/t-maker #t #f) (r/t-maker #f #f) (r/t-maker #f #t))))

View File

@ -24,6 +24,13 @@
(require typed/racket/unsafe)
(unsafe-require/typed racket/base
[string-append (-> String String Integer)])
(unsafe-require/typed racket/list
;; test a keyword function, which expands differently
[check-duplicates
(->* [(Listof Any)] [(-> Any Any Any) #:key (-> Any Any)] Any)])
;; not unbound
check-duplicates
;; UNSAFE
(with-handlers ([(negate exn:fail:contract:blame?) void])