[racket] [Typed Racket] Problem with case->

1 view
Skip to first unread message

Sylvain Sanesti

unread,
May 15, 2012, 4:37:46 PM5/15/12
to us...@racket-lang.org
I don't understand why this code doesn't work :

(: & (case-> [True -> One] [False -> Zero]))
(define (& x) (if (eq? x #t) 1 0))

-> Type Checker: Expected Zero, but got One in: 1

Any idea ?
____________________
Racket Users list:
http://lists.racket-lang.org/users

Sam Tobin-Hochstadt

unread,
May 16, 2012, 10:26:51 AM5/16/12
to Sylvain Sanesti, us...@racket-lang.org
This ought to work. I'll look into why it currently doesn't.

--
sam th
sa...@ccs.neu.edu

Reply all
Reply to author
Forward
0 new messages