From c6d22871bc1a70a59f373f50a1a2a46c71f0e6ee Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Wed, 7 Nov 2012 17:40:06 -0500 Subject: [PATCH] Improve type of call-with-continuation-prompt Now works with the handler argument omitted, in which case the default handler is used. Note that the default handler cannot be used in conjunction with the default prompt tag because it is unsound to do so. original commit: 4e0b38ea79b8ffa84fd099d980a2713a3831d589 --- collects/tests/typed-racket/succeed/prompt-tag.rkt | 11 ++++++++++- collects/typed-racket/base-env/base-env.rkt | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/collects/tests/typed-racket/succeed/prompt-tag.rkt b/collects/tests/typed-racket/succeed/prompt-tag.rkt index 458a1ef7..bb367688 100644 --- a/collects/tests/typed-racket/succeed/prompt-tag.rkt +++ b/collects/tests/typed-racket/succeed/prompt-tag.rkt @@ -19,4 +19,13 @@ (abort-current-continuation pt2 k)) pt2))) pt2 - (λ: ([f : (Integer -> Integer)]) (f 5))) \ No newline at end of file + (λ: ([f : (Integer -> Integer)]) (f 5))) + +;; Test the default handler +(: pt3 (Prompt-Tag Integer ((-> Integer) -> Integer))) +(define pt3 (make-continuation-prompt-tag)) + +(+ 2 + (call-with-continuation-prompt + (λ () (+ 1 (abort-current-continuation pt3 (λ () 5)))) + pt3)) \ No newline at end of file diff --git a/collects/typed-racket/base-env/base-env.rkt b/collects/typed-racket/base-env/base-env.rkt index 49d84fb5..97cc9d07 100644 --- a/collects/typed-racket/base-env/base-env.rkt +++ b/collects/typed-racket/base-env/base-env.rkt @@ -2021,6 +2021,7 @@ [call-with-continuation-prompt (-polydots (a b d c) (cl->* + (-> (-> b) (make-Prompt-Tag b (-> (-> d) d)) (Un b d)) (-> (-> b) (make-Prompt-Tag b (->... '() (c c) d)) (->... '() (c c) d) (Un b d)) (-> (-> b) Univ)))]