scala: Use opt_prefix for caveat

Closes #21722.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>