ribesg
08/04/2017, 10:12 AMtry {
myObject.theField
} catch(t: Throwable) {
log.error("theField is null")
}
horse_badorties
08/04/2017, 10:18 AMdata class Foo(val name: String)
val myFoo = Foo(null)
does not compile, there is no way of getting a Foo with a null name - the compiler prevents that.ribesg
08/04/2017, 10:22 AMhorse_badorties
08/04/2017, 10:23 AMribesg
08/04/2017, 10:23 AMhorse_badorties
08/04/2017, 10:24 AMribesg
08/04/2017, 10:25 AMhorse_badorties
08/04/2017, 10:26 AMribesg
08/04/2017, 10:27 AMhorse_badorties
08/04/2017, 10:37 AMmyObject.theField = JavaTester.returnNull()
throws an IllegalStateException
ribesg
08/04/2017, 10:39 AMString
is considered to return a String?
to a Kotlin callerhorse_badorties
08/04/2017, 10:40 AMribesg
08/04/2017, 10:41 AM@NotNull
on your Java method and still return null, Kotlin is losthorse_badorties
08/04/2017, 10:43 AMribesg
08/04/2017, 10:43 AMhorse_badorties
08/04/2017, 10:43 AMribesg
08/04/2017, 10:44 AMhorse_badorties
08/04/2017, 10:44 AMribesg
08/04/2017, 10:44 AMhorse_badorties
08/04/2017, 10:44 AMribesg
08/04/2017, 10:44 AMhorse_badorties
08/04/2017, 10:44 AMribesg
08/04/2017, 10:45 AMhorse_badorties
08/04/2017, 10:53 AM