Skip to content

Commit 1688a4c

Browse files
Fix 1 occurrence of cond-let-to-cond-define
Internal definitions are recommended instead of `let` expressions, to reduce nesting.
1 parent 323d2ba commit 1688a4c

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

typed-racket-lib/typed-racket/utils/tc-utils.rkt

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,17 @@ don't depend on any other portion of the system
136136
(reset-errors!)
137137
(log-type-error (err-msg f) (err-stx f))
138138
(raise-typecheck-error (err-msg f) (err-stx f))]
139-
[else (let ([stxs
140-
(for/list ([e (in-list l)])
141-
(with-handlers ([exn:fail:syntax?
142-
(λ (e) ((error-display-handler) (exn-message e) e))])
143-
(log-type-error (err-msg e) (err-stx e))
144-
(raise-typecheck-error (err-msg e) (err-stx e)))
145-
(err-stx e))])
146-
(reset-errors!)
147-
(unless (null? stxs)
148-
(raise-typecheck-error (format "Summary: ~a errors encountered"
149-
(length stxs))
150-
(apply append stxs))))]))
139+
[else (define stxs
140+
(for/list ([e (in-list l)])
141+
(with-handlers ([exn:fail:syntax? (λ (e)
142+
((error-display-handler) (exn-message e) e))])
143+
(log-type-error (err-msg e) (err-stx e))
144+
(raise-typecheck-error (err-msg e) (err-stx e)))
145+
(err-stx e)))
146+
(reset-errors!)
147+
(unless (null? stxs)
148+
(raise-typecheck-error (format "Summary: ~a errors encountered" (length stxs))
149+
(apply append stxs)))]))
151150

152151
;; Returns #t if there's a type error recorded at the same position as
153152
;; the given syntax object. Does not return a useful result if the

0 commit comments

Comments
 (0)