Use `gcast` instead of `typeRep` to check type equality.