Missing arguments to the interpolation -
s"Found elements satisfying our criteria"
37object Main extends App {
38 var filtered = Utils.filterBy(Range.inclusive(1, 100).toArray, criteria = x => x % 2 == 0)
39 if (!filtered.isEmpty) {
40 println(s"Found elements satisfying our criteria")41 }
42
43 var lang1 = "Scala"
Description
Empty interpolated string is usually a result of human error - either that the programmer forgot to specify the required arguments, or that the string wasn't meant to be interpolated. Such strings can critically alter the behaviour and control-flow of the program if the program relies on it.
Bad Practice
val intro = s"Hi! My name is name"
Recommended
val intro = s"Hi! My name is $name"