blob: ef18154c485e1a3b10711bfe20157f78d8f14636 [file]
// RUN_PIPELINE_TILL: FRONTEND
// CHECK_TYPE
fun foo1(x: Number, cond: Boolean): Boolean {
val result = cond && ((x as Int) == 42)
checkSubtype<Int>(<!ARGUMENT_TYPE_MISMATCH!>x<!>)
return result
}
fun foo2(x: Number, cond: Boolean): Boolean {
val result = ((x as Int) == 42) && cond
checkSubtype<Int>(x)
return result
}
fun foo3(x: Number, cond: Boolean): Boolean {
val result = cond || ((x as Int) == 42)
checkSubtype<Int>(<!ARGUMENT_TYPE_MISMATCH!>x<!>)
return result
}
fun foo4(x: Number, cond: Boolean): Boolean {
val result = ((x as Int) == 42) || cond
checkSubtype<Int>(x)
return result
}
/* GENERATED_FIR_TAGS: andExpression, asExpression, classDeclaration, disjunctionExpression, equalityExpression,
funWithExtensionReceiver, functionDeclaration, functionalType, infix, integerLiteral, localProperty, nullableType,
propertyDeclaration, smartcast, typeParameter, typeWithExtension */