Why this code is giving me the NPE error?
fun main() {
val myObj: MyObj? = null
print(myObj?.someVal!!)
}
class MyObj{
val someVal = 1
}
Does non-null assertion evaluate the whole expression before? I thought that myObj? should be enough to print null here.