typed-racket/typed-racket-test/fail/gh-issue-165.rkt
Asumu Takikawa 29144c7932 Fix handling of let rhs that don't return
In the case that a let rhs doesn't return and therefore the
bodies of the let are unreachable, the bodies need to be marked
as ignored for the optimizer.

In addition, don't attempt unboxed let optimization at all
if the return type is Nothing since it probably means some
body expressions have no type.

Closes GH issue #165
2015-08-11 12:07:27 -04:00

18 lines
287 B
Racket

#;
(exn-pred #rx"match-define")
#lang typed/racket
(struct a ([x : Integer]))
(struct b ([y : Integer]))
;; test for original report
(: f (-> a Integer))
(define (f arg)
(match-define (a (b y)) arg)
(+ 1 y))
;; simple test case
(let ()
(match-define (? string? x) 3)
(+ 1 2))