Fix call/comp's type
original commit: 3f2d4663a87939a02223b6620407e25b0507aa4a
This commit is contained in:
parent
50713b7368
commit
a0c32ff288
17
collects/tests/typed-racket/succeed/call-comp.rkt
Normal file
17
collects/tests/typed-racket/succeed/call-comp.rkt
Normal file
|
@ -0,0 +1,17 @@
|
|||
#lang typed/racket
|
||||
|
||||
(require racket/control)
|
||||
|
||||
(: tag (Prompt-Tagof Integer (Integer -> Integer)))
|
||||
(define tag (make-continuation-prompt-tag))
|
||||
|
||||
(call-with-continuation-prompt
|
||||
(λ ()
|
||||
(+ 1
|
||||
((inst call-with-composable-continuation Integer (Integer -> Integer)
|
||||
Integer)
|
||||
(lambda: ([k : (Integer -> Integer)]) (k 1))
|
||||
tag)))
|
||||
tag
|
||||
(λ: ([x : Integer]) (+ 1 x)))
|
||||
|
|
@ -14,7 +14,8 @@
|
|||
|
||||
;; Test call/comp & abort
|
||||
(call-with-continuation-prompt
|
||||
(λ () (+ 1 (call-with-composable-continuation
|
||||
(λ () (+ 1 ((inst call-with-composable-continuation
|
||||
Integer ((Integer -> Integer) -> Integer) Integer)
|
||||
(λ: ([k : (Integer -> Integer)])
|
||||
(abort-current-continuation pt2 k))
|
||||
pt2)))
|
||||
|
|
|
@ -2036,9 +2036,13 @@
|
|||
[call/cc (-poly (a b) (((a . -> . (Un)) . -> . b) . -> . (Un a b)))]
|
||||
[call-with-composable-continuation
|
||||
(-polydots (b c a)
|
||||
(cl->*
|
||||
(-> (->... '() (a a) b) (make-Prompt-Tagof b c)
|
||||
(make-ValuesDots '() a 'a))))]
|
||||
(-> ;; takes a continuation and should return the same
|
||||
;; type as the continuation's input type
|
||||
(-> (->... '() (a a) b) (make-ValuesDots '() a 'a))
|
||||
(make-Prompt-Tagof b c)
|
||||
;; the continuation's input is the same as the
|
||||
;; return type here
|
||||
(make-ValuesDots '() a 'a)))]
|
||||
[call-with-escape-continuation
|
||||
(-poly (a b) (((a . -> . (Un)) . -> . b) . -> . (Un a b)))]
|
||||
[call/ec (-poly (a b) (((a . -> . (Un)) . -> . b) . -> . (Un a b)))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user