I was running into a flycheck warning about a function which may not be defined.
Since the function is a small optional dependency, I am inlining it in case the package that provides cannot be loaded.
I first tried I checking if the package failed to be required before filling in the function:
(unless (require 'selcand nil t) (defun selcand-select () ...))
This gave me
the function ‘selcand-select’ is not known to be defined.
Which makes sense since the compiler has no idea whether the
will define the function
So I added an explicit
(unless (and (require 'selcand nil t) (fboundp 'selcand-select)) (defun selcand-select (cands &optional prompt stringify) ...))
which still gave me the same error.