In this case you actually don't have to worry about this. The error is because your case statement is too verbose. Change to the following:
rawData.groupBy(_._1).map(case (first, second) =>
C(first, second.map(_._2))
)
The types in the case statement restrict the type of the tuple (which is unnecessary). However, they restrict it in a way which is not verifiable at runtime (due to type erasure), that's why you get the error.