Kotlin generates redundant bytecode

By default Kotlin is pessimistic on nullability. Your function a is public so could be called from Java with a null parameter. It will check explicitly for this (there is a way to disable this if desired). Note that CheckCast does not throw on null values so will let an actual null value through.

1 Like