I just wrote a code like this:
val chosenProfile = /* some expression that can be null, i.e. QQQ? */
if (chosenProfile?.likesUser == true) { ..... this.foo(chosenProfile, extra)
The compiler says “Error:(316, 32) Type mismatch: inferred type is QQQ? but QQQ was expected”.
I think it can be inferred that if the program reaches here, the type is QQQ.