Problems with Java raw type wrappers

Kotlin auto-casting is great unless you are using java types in kotlin, ej:

fun example(i: java.lang.Integer){

}

can not be called with:

example(1) //Wont compile, it claims "The integer literal does not conform the expected type integer"

From Kotlin, it can be called like this from Java, and a Java code with that type can be called like this from kotlin.

The problem resides if you use Java types in your Kotlin code, not if you use java compiled code with Java types.

Kotlin is not intended to use Java types, but this strange approach in TensorFlow forces you to use them.

The reflection is for adding primitives to DataType’s map, it’s for modifying a TensorFlow class, but this just will work for this case, it is not a global solution.