Have optimizer skip more code that is not typechecked.
This commit is contained in:
parent
3149b0a305
commit
6ccb0939f8
|
@ -24,9 +24,9 @@
|
|||
(pattern opt:ignore-table^)
|
||||
|
||||
;; Can't optimize the body of this code because it isn't typechecked
|
||||
(pattern (~and _:kw-lambda^
|
||||
((~and op let-values)
|
||||
([(i:id) e-rhs:opt-expr]) e-body:expr ...))
|
||||
(pattern (~and (~or _:kw-lambda^ _:opt-lambda^)
|
||||
((~and op let-values)
|
||||
([(i:id) e-rhs:opt-expr]) e-body:expr ...))
|
||||
#:with opt (quasisyntax/loc/origin this-syntax #'op
|
||||
(op ([(i) e-rhs.opt]) e-body ...)))
|
||||
|
||||
|
|
12
typed-racket-test/optimizer/tests/opt-arg.rkt
Normal file
12
typed-racket-test/optimizer/tests/opt-arg.rkt
Normal file
|
@ -0,0 +1,12 @@
|
|||
#lang typed/racket/base
|
||||
|
||||
;; The optimizer now looks at all expressions regardless of shape (to log
|
||||
;; all expressions with type (Vectorof Float) as candidates for uses of
|
||||
;; flvectors).
|
||||
;; This revealed that, previously, the optimizer did not skip the generated
|
||||
;; body of optional arg function definitions (which is not typechecked, and so
|
||||
;; should be skipped). It did for kw arg functions, but not optional.
|
||||
;; This is now fixed, and this test is to guard against regressions.
|
||||
|
||||
(define (slicef-at [force? #f])
|
||||
#f)
|
Loading…
Reference in New Issue
Block a user