blob: cb4f1a286bb3e327283b2e76837cf50d511d07a6 [file]
// RUN_PIPELINE_TILL: BACKEND
// WITH_STDLIB
@file:MustUseReturnValues
fun stringF(): String = ""
fun nsf(): String? = "null"
fun Any.consume(): Unit = Unit
inline fun <T, R> T.myLet(block: (T) -> R): R {
return block(this)
}
fun returnsString(): String {
nsf()?.myLet { return it } // inferred to Nothing
return ""
}
fun main() {
stringF().myLet { it }
stringF().myLet { 2 }
stringF().let { 2 }
}
/* GENERATED_FIR_TAGS: annotationUseSiteTargetFile, funWithExtensionReceiver, functionDeclaration, functionalType,
inline, integerLiteral, lambdaLiteral, nullableType, safeCall, stringLiteral, thisExpression, typeParameter */