Move type similarity checks after unboxing.