uli
09/04/2019, 1:28 PMval x : (()->Unit)? = null
fun main() {
if (x != null) {
x.invoke()
}
}
while with this one the compiler complains about the reference having a nullable type:
val x : (()->Unit)? = null
fun main() {
if (x != null) {
x()
}
}
Compiler and Android Studio even agree on complaining about the second snippet.
Am I missing something?jw
09/04/2019, 1:42 PMwasyl
09/04/2019, 1:51 PMuli
09/04/2019, 3:38 PM