passsy
05/29/2016, 10:09 PM// automatically non-null
val handler = Thread.getDefaultUncaughtExceptionHandler()
// no warning, everything compiles, crashes at runtime
handler.uncaughtException(thread, throwable)
// alt + enter -> "specify type explicitly" suggests nullable type
val handler: Thread.UncaughtExceptionHandler? = Thread.getDefaultUncaughtExceptionHandler()
// Error: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Thread.UncaughtExceptionHandler?
handler.uncaughtException(thread, throwable)