y)))
'Int)
+ ; case statements
+(test-types
+ (typecheck '((data A (foo B))
+ (data B (bar Int))
+ (case (foo (bar 32))
+ [(foo x) x])))
+ 'B)
+
+(test-types
+ (typecheck '((case 42
+ [23 (= 1 2)]
+ [x (= x 1)])))
+ 'Bool)
; type annotations
(test-prog '((data Foo [a] [b] [c])
(let ([x b])
(case x
- [a 1]
- [b 2]
- [c 3])))
+ [a b]
+ [b a]
+ [c x])))
2)