Quick question: could this piece of code cause a N...
# announcements
d
Quick question: could this piece of code cause a NPE?
Copy code
val y = listOf<Any>()
val x = y.firstOrNull({ it -> it.value is AType })?.value as AType
    SomeConstructor(x.value)
It seems like it should since x could be null, but my IDE doesn’t complain about it and it seems to compile fine.