(1) This should work but doesn't, with an unhelpful error:
#lang typed/racket/base
(: example-1 : -> Void)
(define (example-1)
(call-with-exception-handler
(λ (e)
(println "the handler")
e)
(λ ()
(println "the message"))))
(2) This could be better:
#lang typed/racket/base
(define (example-2)
(call-with-exception-handler
(λ (e) e)
(λ ()
(+ 2 2))))
> example-2
- : (-> Any) ;; this would be more accurate as : (-> Positive-Index)
I can fix this with this, which seems sound:
(require/typed/provide racket/base
[call-with-exception-handler (∀ (A) ((Any -> Any) (-> A) -> A))])
I don't understand the syntax of base-env.rkt so I'm not sure how to PR this fix myself.
(1) This should work but doesn't, with an unhelpful error:
(2) This could be better:
I can fix this with this, which seems sound:
I don't understand the syntax of base-env.rkt so I'm not sure how to PR this fix myself.