Update require/typed in no-check mode for keywords

Closes PR 14463

original commit: 2a32c588157263489c4928fa90c50409dbb3b87b
This commit is contained in:
Asumu Takikawa 2014-04-29 21:27:18 -04:00
parent 23b147607f
commit 36a34fd3ea
2 changed files with 20 additions and 0 deletions

View File

@ -25,11 +25,16 @@
(define-syntax-class struct-clause
;#:literals (struct)
#:attributes (nm (body 1))
(pattern [#:struct nm:opt-rename (body ...)])
(pattern [struct nm:opt-rename (body ...)]
#:fail-unless (eq? 'struct (syntax-e #'struct)) #f))
(define-syntax-class opaque-clause
;#:literals (opaque)
#:attributes (ty pred opt)
(pattern [#:opaque ty:id pred:id]
#:with opt #'())
(pattern [#:opaque ty:id pred:id #:name-exists]
#:with opt #'(#:name-exists))
(pattern [opaque ty:id pred:id]
#:fail-unless (eq? 'opaque (syntax-e #'opaque)) #f
#:with opt #'())

View File

@ -0,0 +1,15 @@
#lang typed/racket/no-check
;; Test for PR 14463. Check that require/typed with #:opaque works
;; in no-check mode
(module untyped racket
(provide f thing?)
(define (f x) x)
(define (thing? x) #t))
(require/typed 'untyped
[#:opaque Thing thing?]
[f (Thing -> Thing)])
(thing? 3)