* lisp/emacs-lisp/comp.el (comp-function-type-spec): Make it robust
against closures (bug#66021).
type-spec )
(when-let ((res (gethash function comp-known-func-cstr-h)))
(setf type-spec (comp-cstr-to-type-spec res)))
- (let ((f (symbol-function function)))
- (when (and (null type-spec)
+ (let ((f (and (symbolp function)
+ (symbol-function function))))
+ (when (and f
+ (null type-spec)
(subr-native-elisp-p f))
(setf kind 'inferred
type-spec (subr-type f))))