(define impc:ti:find-unresolved-simple-types
(lambda (union)
(let ((unresolved (cl:remove #f (map (lambda (x) ;; return the first bad variable that is not a closure
(if (null? (cdr x)) #f
(if (and (list? (cdr x)) ;; check there are multiple choices
(number? (cadr x))
(not (member (modulo (cadr x) *impc:ir:pointer*)
(list *impc:ir:tuple* *impc:ir:closure* *impc:ir:array* *impc:ir:vector*))) ;; make sure it's a base type (not closure or tuple)
(cl:every impc:ir:type? (cdr x))) ;; check that it's choices are valid (not null)
x #f)))
union))))
(if (null? unresolved) #f
unresolved))))