blob: db920cdc3f80e40c5c5c3d0985c98510664ffca6 [file]
// RUN_PIPELINE_TILL: CODEGEN
// ISSUE: KT-81948
// DIAGNOSTICS: -UNCHECKED_CAST
// LANGUAGE: +DiscriminateNothingAsNullabilityConstraintInInference
// FIR_DUMP
// DUMP_INFERENCE_LOGS: FIXATION
fun <R> myRun(x: () -> R): R = x()
fun <T> materialize(): T? = "" as T?
// R should be inferred to String?, not to Nothing?
val x: String? = myRun { materialize() }!!
/* GENERATED_FIR_TAGS: asExpression, checkNotNullCall, functionDeclaration, functionalType, lambdaLiteral, nullableType,
propertyDeclaration, stringLiteral, typeParameter */