fix expected-ty propagation in cond else; closes #3

This commit is contained in:
Stephen Chang 2016-03-18 11:57:46 -04:00
parent 7f593b52c8
commit c89aa1be19
2 changed files with 5 additions and 1 deletions

View File

@ -482,7 +482,7 @@
#:when (same-types? #'(ty_body ...))
#:with τ_out (stx-car #'(ty_body ...))
#:with [last-body- last-ty] (if (attribute else_body)
(infer+erase #'else_body)
(infer+erase #'(add-expected else_body ty-expected))
(infer+erase #'(void)))
#:with ([last-b- last-b-ty] ...) (if (attribute else_body)
(infers+erase #'(else_b ...))

View File

@ -32,3 +32,7 @@
(h))
(check-type i : (→/test (Result Int String)))
(define (f/cond [b : Bool] -> (Result Int String))
(cond [b (ok 1)]
[else (ok 0)]))