score:2

Accepted answer

the problem is that you assigned boolean result of method contains to a val inspectvariable. this operation has a return type of unit. but filter method requires boolean.

just remove val inspectvariable = and this should fix it.

or return the value by adding new line with content inspectvariable after assigning the value.

as shown here

val filteredwordcounts = sortedwordcounts.filter { x =>
  val inspectvariable = commonenglishstopwords.contains(x._1)//put your breakpoint here
  inspectvariable
}

Related Query

More Query from same tag