From 032fffb9111cf197a1cf5dede63a8924dd69ee5f Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Sat, 25 May 2013 13:38:33 -0700 Subject: [PATCH] Cleanup tc-app-objects a bit. original commit: 16afe191d8c39d518f6496a45a89e9de05f6921b --- .../typecheck/tc-app/tc-app-objects.rkt | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/collects/typed-racket/typecheck/tc-app/tc-app-objects.rkt b/collects/typed-racket/typecheck/tc-app/tc-app-objects.rkt index 37640c63..c969aca6 100644 --- a/collects/typed-racket/typecheck/tc-app/tc-app-objects.rkt +++ b/collects/typed-racket/typecheck/tc-app/tc-app-objects.rkt @@ -53,17 +53,16 @@ n (stringify tnames))) (for-each (match-lambda [(list tname tfty opt?) - (let ([s (dict-ref name-assoc tname - (lambda () - (unless opt? - (tc-error/delayed "value not provided for named init arg ~a" - tname)) - #f))]) - (if s - ;; this argument was present - (tc-expr/check s (ret tfty)) - ;; this argument wasn't provided, and was optional - #f))]) + (define s + (dict-ref name-assoc tname + (lambda () + (unless opt? + (tc-error/delayed "value not provided for named init arg ~a" + tname)) + #f))) + ;; Only check the argument if it is provided + (when s + (tc-expr/check s (ret tfty)))]) tnflds) (ret (make-Instance c))] [(tc-result1: t)