How to constrain a type to a subset of another?-Collection of common programming errors

Value-dependent typing in languages such as Coq and Agda can do this, though not Scala.

Depending on the exact use-case, there are ways of encoding peano numbers in the type system that may, however, help you.

You might also want to try defining both Even and Odd along with some sealed abstract supertype (OddOrEven perhaps) and a factory method that returns the correct instance from any given Integer.

Another possibility is to define Even as an extractor.