Cleanup tc-app-objects a bit.
This commit is contained in:
parent
e54e67fc29
commit
16afe191d8
|
@ -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
|
||||||
(lambda ()
|
(dict-ref name-assoc tname
|
||||||
(unless opt?
|
(lambda ()
|
||||||
(tc-error/delayed "value not provided for named init arg ~a"
|
(unless opt?
|
||||||
tname))
|
(tc-error/delayed "value not provided for named init arg ~a"
|
||||||
#f))])
|
tname))
|
||||||
(if s
|
#f)))
|
||||||
;; this argument was present
|
;; Only check the argument if it is provided
|
||||||
(tc-expr/check s (ret tfty))
|
(when s
|
||||||
;; this argument wasn't provided, and was optional
|
(tc-expr/check s (ret tfty)))])
|
||||||
#f))])
|
|
||||||
tnflds)
|
tnflds)
|
||||||
(ret (make-Instance c))]
|
(ret (make-Instance c))]
|
||||||
[(tc-result1: t)
|
[(tc-result1: t)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user