* lisp/emacs-lisp/comp.el (comp-fwprop-call): Propagate functions
also when called under `funcall'.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
F is the function being called with arguments ARGS.
Fold the call in case."
(unless (comp-function-call-maybe-fold insn f args)
+ (when (and (eq 'funcall f)
+ (comp-mvar-value-vld-p (car args)))
+ (setf f (comp-mvar-value (car args))
+ args (cdr args)))
(when-let ((cstr-f (gethash f comp-known-func-cstr-h)))
(let ((cstr (comp-cstr-f-ret cstr-f)))
(setf (comp-mvar-range lval) (comp-cstr-range cstr)
((defun comp-tests-ret-type-spec-f (x)
(when (<= 1 x 5)
(1- x)))
- (or null float (integer 0 4)))))
+ (or null float (integer 0 4)))
+
+ ;; 47
+ ((defun comp-tests-ret-type-spec-f ()
+ (error "foo"))
+ nil)))
(defun comp-tests-define-type-spec-test (number x)
`(comp-deftest ,(intern (format "ret-type-spec-%d" number)) ()