The type fooin this case will be inferred to Nothing?, which is a special type. In short, it Nothingis a type that is a subtype of each type in Kotlin (therefore Nothing?a subtype of each type NULL), has no instances, and can be used as a return type for functions that can never return.
Nothing , null Nothing?, .
Nothing , , .