;; (closure-ref closure a i32)
(define impc:ti:closure-refcheck-check
(lambda (ast vars kts request?)
;; (println 'cls2 'ref 'check: ast 'request? request?)
(if (<> (length ast) 3)
(impc:compiler:print-bad-arity-error ast))
(let* (;; a should be a closure of some kind
(a (if (and (symbol? (cadr ast))
(impc:ti:closure-exists? (symbol->string (cadr ast))))
#t ; // yes (cadr ast) is a globally defined closure
(impc:ti:type-check (cadr ast) vars kts #f))) ;; request?)))
;; b should be a string (the var's name)
(b (impc:ti:type-check (caddr ast) vars kts (list *impc:ir:si8*))))
(list *impc:ir:i1*))))