Cleanup tc-app-objects a bit.

This commit is contained in:
Eric Dobson 2013-05-25 13:38:33 -07:00
parent e54e67fc29
commit 16afe191d8

View File

@ -53,17 +53,16 @@
n (stringify tnames))) n (stringify tnames)))
(for-each (match-lambda (for-each (match-lambda
[(list tname tfty opt?) [(list tname tfty opt?)
(let ([s (dict-ref name-assoc tname (define s
(dict-ref name-assoc tname
(lambda () (lambda ()
(unless opt? (unless opt?
(tc-error/delayed "value not provided for named init arg ~a" (tc-error/delayed "value not provided for named init arg ~a"
tname)) tname))
#f))]) #f)))
(if s ;; Only check the argument if it is provided
;; this argument was present (when s
(tc-expr/check s (ret tfty)) (tc-expr/check s (ret tfty)))])
;; this argument wasn't provided, and was optional
#f))])
tnflds) tnflds)
(ret (make-Instance c))] (ret (make-Instance c))]
[(tc-result1: t) [(tc-result1: t)