3 ms·
Not a big deal. The exclamation mark only appears in IDE tooltips and things, you can't express it directly. It could therefore be changed without breaking anyt
by mike_hearn 2y ago
Not a big deal. The exclamation mark only appears in IDE tooltips and things, you can't express it directly. It could therefore be changed without breaking anything. If you want a 'flex type' you have to use type inference:
// Java
Baz bar() { return new Baz(); }
// Kotlin
val foo = someJavaObject.bar()
foo now has type Baz! but the moment you declare the type of foo explicitly you're forced to pick, and an NPE check is done at that moment.