
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
18 lines
287 B
Racket
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))
|