(modes MODES)Specify that this command is meant to be applicable for MODES only.
What is the practical effect of (modes ...) in declare form?
I find that I can still call function shyn/func:
(defun shyn/func ()
(declare (modes text-mode))
(interactive))
in any mode other than text-mode.
Update 2023-6-15
Reported as bug#64045; Related documentation got clarified.