Thanks for the suggestion, @charpov. Sadly, I don’t see how to use this though.
For example, I’ve updated my code as follows, but IntellJ now gives a different error.
@SuppressWarnings("unused")
def prog2[A,B,C](@unused _unused : A, val2:B, code2: => C):B = {
code2 // eval for side effect
val2
}
type mismatch;
found : String("unused")
required: Array[String]
def prog2[A,B,C](@SuppressWarnings("unused") @unused _unused : A, val2:B, code2: => C):B = {