typed-racket icon indicating copy to clipboard operation
typed-racket copied to clipboard

case-lambda doesn't typecheck with rest-args as expected

Open lwhjp opened this issue 5 years ago • 2 comments

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)))

lwhjp avatar Nov 08 '19 14:11 lwhjp

I ran into this earlier this week.

LiberalArtist avatar Dec 16 '19 01:12 LiberalArtist

Related to #1203

capfredf avatar Mar 23 '22 02:03 capfredf