SI-8607 Generalize previous change to preErase

In the previous commit, we avoided an awkward chain of casts
by exploiting the knowledge that Scala defined classes will
by JVM accessible, and as such immune to `LinkageError`s when
used as the target of a cast.

This commit generalized this to the entire fix for SI-4283,
rather than just for derived value classes.