From 36a34fd3eabb24faf6b6d6be727b9531ab4e1d6d Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Tue, 29 Apr 2014 21:27:18 -0400 Subject: [PATCH] Update require/typed in no-check mode for keywords Closes PR 14463 original commit: 2a32c588157263489c4928fa90c50409dbb3b87b --- .../typed/private/no-check-helper.rkt | 5 +++++ .../tests/typed-racket/succeed/pr14463.rkt | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr14463.rkt diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed/private/no-check-helper.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed/private/no-check-helper.rkt index 0f94e540..cb38489d 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed/private/no-check-helper.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed/private/no-check-helper.rkt @@ -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 #'()) diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr14463.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr14463.rkt new file mode 100644 index 00000000..6bd32576 --- /dev/null +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/succeed/pr14463.rkt @@ -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)