The automated feedback system for bash incorrectly says “$/${} is unnecessary on arithmetic variables” when using an associative array in an arithmetic context. In the following example, removing the $ breaks the code:
CHAR_VALUES is used in an arithmetic context so (( ${CHAR_VALUES[$char]} )) can be written (( CHAR_VALUES[$char] )). However, since CHAR_VALUES is an associative array, the [...] isn’t an arithmetic context and $ is needed for $char.
Although shellcheck’s message is somewhat confusing, what it is saying is that because you are using $char without double-quotes, it assume that it is a number, and if its assumption is right, you don’t need to put the preceding dollar sign. If you double quotes $char, then shellcheck understands your intention correctly.