https://kotlinlang.org logo
#announcements
Title
# announcements
w

witoldsz

06/18/2017, 10:28 PM
Looks like there is no simple solution, you say
!!
is ugly and can make bad, for me the hidden assumptions make my new and shiny Kotlin app throw NPE… (and I was supposed to see NPE ever again). Maybe
T!
types should have yet another dot-like operator, so it would be special and everyone could tell "aha, this is Java, nulls allowed".
a

Andreas Sinz

06/19/2017, 7:03 AM
witoldsz: Kotlin assumed that every T from java is nullable, but that just cluttered up kotlin code too much, so they went with
T!
. I'd love to have a compiler-flag that turns
T!
into
T?
right now you have to check every
T!
from java yourself and you are still safe from NPEs
3 Views