Skip to content

Commit 2bf9a68

Browse files
Fix 2 occurrences of define-let-to-double-define
This `let` expression can be pulled up into a `define` expression.
1 parent 5dcdb5f commit 2bf9a68

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

typed-racket-lib/typed-racket/private/shallow-rewrite.rkt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,12 +239,12 @@
239239
"#%plain-lambda formals"
240240
#'formals
241241
args)]))
242-
(define check*
243-
(let ([dom+ (for/fold ([acc '()])
244-
([dom (in-list dom*)]
245-
#:when (pair? dom))
246-
(cons (cdr dom) acc))])
247-
(protect-loop rst dom+)))
242+
(define dom+
243+
(for/fold ([acc '()])
244+
([dom (in-list dom*)]
245+
#:when (pair? dom))
246+
(cons (cdr dom) acc)))
247+
(define check* (protect-loop rst dom+))
248248
(define ann-ty
249249
(and (type-annotation fst #:infer #f)
250250
(get-type fst #:infer #t #:default Univ)))

typed-racket-test/main.rkt

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -163,23 +163,19 @@
163163

164164
(define (just-one p*)
165165
(define-values (path p b) (split-path p*))
166+
(define dir (path->string path))
166167
(define f
167-
(let ([dir (path->string path)])
168-
(cond [(regexp-match? #rx"fail/" dir )
169-
(lambda (p thnk)
170-
(define-values (pred info) (exn-pred p))
171-
(parameterize ([error-display-handler void])
172-
(with-check-info
173-
(['predicates info])
174-
(check-exn pred thnk))))]
175-
[(regexp-match? #rx"succeed/" dir)
176-
(lambda (p thnk) (check-not-exn thnk))]
177-
[(regexp-match? #rx"optimizer/tests/$" dir)
178-
(lambda (p* thnk) (test-opt p))]
179-
[(regexp-match? #rx"optimizer/missed-optimizations/$" dir)
180-
(lambda (p* thnk) (test-missed-optimization p))]
181-
[else
182-
(error 'just-one "Unknown test kind for test: ~a" p*)])))
168+
(cond
169+
[(regexp-match? #rx"fail/" dir)
170+
(lambda (p thnk)
171+
(define-values (pred info) (exn-pred p))
172+
(parameterize ([error-display-handler void])
173+
(with-check-info (['predicates info]) (check-exn pred thnk))))]
174+
[(regexp-match? #rx"succeed/" dir) (lambda (p thnk) (check-not-exn thnk))]
175+
[(regexp-match? #rx"optimizer/tests/$" dir) (lambda (p* thnk) (test-opt p))]
176+
[(regexp-match? #rx"optimizer/missed-optimizations/$" dir)
177+
(lambda (p* thnk) (test-missed-optimization p))]
178+
[else (error 'just-one "Unknown test kind for test: ~a" p*)]))
183179
(test-suite
184180
(path->string p)
185181
(f

0 commit comments

Comments
 (0)