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