match.scala:3: warning: match may not be exhaustive. It would fail on the following input: CC(B2) def test(c: CC): Unit = c match { ^ error: No warnings can be incurred under -Xfatal-warnings. one warning found one error found