mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
26 lines
653 B
Kotlin
Vendored
26 lines
653 B
Kotlin
Vendored
// !CHECK_TYPE
|
|
|
|
fun foo1(x: Number, cond: Boolean): Boolean {
|
|
val result = cond && ((x as Int) == 42)
|
|
checkSubtype<Int>(<!TYPE_MISMATCH!>x<!>)
|
|
return result
|
|
}
|
|
|
|
fun foo2(x: Number, cond: Boolean): Boolean {
|
|
val result = ((x as Int) == 42) && cond
|
|
checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>x<!>)
|
|
return result
|
|
}
|
|
|
|
fun foo3(x: Number, cond: Boolean): Boolean {
|
|
val result = cond || ((x as Int) == 42)
|
|
checkSubtype<Int>(<!TYPE_MISMATCH!>x<!>)
|
|
return result
|
|
}
|
|
|
|
fun foo4(x: Number, cond: Boolean): Boolean {
|
|
val result = ((x as Int) == 42) || cond
|
|
checkSubtype<Int>(<!DEBUG_INFO_SMARTCAST!>x<!>)
|
|
return result
|
|
}
|