visitTypeInsn
A CHECKCAST to an inaccessible class is itself access-checked, so a cast the Kotlin compiler emitted around a value we just erased would re-introduce the failure the erasure avoids. Widen it to Object — the value already is of that type at runtime; the cast existed only to satisfy the verifier.
NEW and INSTANCEOF are left alone: both name a specific class and neither survives erasure, so a snippet that allocates or type-tests a package-private class still fails.