typed-racket
typed-racket copied to clipboard
case-lambda doesn't typecheck with rest-args as expected
What version of Racket are you using?
7.4
What program did you run?
#lang typed/racket
(: foo (-> Any * Any))
(define foo
(case-lambda
[() 'one]
[(a) 'two]
[(a b . cs) 'three]))
What should have happened?
The program shoudl type-check without error.
If you got an error message, please include it here.
Type Checker: type mismatch
expected: (-> Any * Any)
given: (->* () (Any Any) #:rest Any Any) in: (case-lambda (() (quote one)) ((a) (quote two)) ((a b . cs) (quote three)))
I ran into this earlier this week.
Related to #1203