I have added the scalac command line argument -Ywarn-value-discard to my build because this would have caught a subtle bug that I just found in my code. However, I now get some warnings for “discarded non-Unit value” that are about intentional discards, not bugs. How do I suppress those warnings?
I have added the scalac command line argument -Ywarn-value-discard to my build because this
Share
You suppress these warning by explictly returning unit (that is
()).By example turn this:
into: