blob: e92c46aa39c9e773f1b2d538fd38a0c5abfffe81 [file]
// RUN_PIPELINE_TILL: FRONTEND
// DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
fun println() {}
fun foo(x: Any) {}
fun <T> fooGeneric(x: T) {}
fun testMixedIfAndWhen() =
if (true)
when {
true -> if (true) <!IMPLICIT_CAST_TO_ANY!>42<!>
else <!IMPLICIT_CAST_TO_ANY!>1<!>
true -> if (true) <!IMPLICIT_CAST_TO_ANY!>42<!>
else <!IMPLICIT_CAST_TO_ANY!>println()<!>
else -> <!INVALID_IF_AS_EXPRESSION!>if<!> (true) <!IMPLICIT_CAST_TO_ANY!>println()<!>
}
else <!IMPLICIT_CAST_TO_ANY!>println()<!>
fun testWrappedExpressions() =
if (true) {
println()
<!INVALID_IF_AS_EXPRESSION!>if<!> (true) {
println()
if (true) {
<!IMPLICIT_CAST_TO_ANY!>println()<!>
}
else <!IMPLICIT_CAST_TO_ANY!>{}<!>
}
}
else {
(((<!IMPLICIT_CAST_TO_ANY!>((42)) + 1<!>)))
}
/* GENERATED_FIR_TAGS: functionDeclaration, ifExpression, integerLiteral, nullableType, typeParameter, whenExpression */