Update require/typed in no-check mode for keywords
Closes PR 14463
This commit is contained in:
parent
f58cfe596a
commit
2a32c58815
|
@ -25,11 +25,16 @@
|
||||||
(define-syntax-class struct-clause
|
(define-syntax-class struct-clause
|
||||||
;#:literals (struct)
|
;#:literals (struct)
|
||||||
#:attributes (nm (body 1))
|
#:attributes (nm (body 1))
|
||||||
|
(pattern [#:struct nm:opt-rename (body ...)])
|
||||||
(pattern [struct nm:opt-rename (body ...)]
|
(pattern [struct nm:opt-rename (body ...)]
|
||||||
#:fail-unless (eq? 'struct (syntax-e #'struct)) #f))
|
#:fail-unless (eq? 'struct (syntax-e #'struct)) #f))
|
||||||
(define-syntax-class opaque-clause
|
(define-syntax-class opaque-clause
|
||||||
;#:literals (opaque)
|
;#:literals (opaque)
|
||||||
#:attributes (ty pred opt)
|
#: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]
|
(pattern [opaque ty:id pred:id]
|
||||||
#:fail-unless (eq? 'opaque (syntax-e #'opaque)) #f
|
#:fail-unless (eq? 'opaque (syntax-e #'opaque)) #f
|
||||||
#:with opt #'())
|
#:with opt #'())
|
||||||
|
|
|
@ -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)
|
Loading…
Reference in New Issue
Block a user