3 ms·
This might be a better link based on your concern: https://kotlinlang.org/docs/reference/java-interop.html#null-safety-and-platform-types https://kotlinlang.org
by bluejekyll 9y ago
This might be a better link based on your concern: https://kotlinlang.org/docs/reference/java-interop.html#null-safety-and-platform-types https://kotlinlang.org/docs/reference/java-interop.html#null...
This feels like a trad-off between ease-of-use/adoption. It's effectively undefined behavior to reference a nullable type from Java. Another way to consider this is that it's not necessarily worse than working natively in Java, but it can over time be better. This trade-off seems reasonable, as there is no great answer to this problem, but it's almost identical to Java's auto-unboxing of Integer types to int.