[FIR] Add test for both KT-10240 and KT-19446
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
fun a(): Int {
|
||||
fun b(): Int {
|
||||
var c: Int? = null
|
||||
if (c == null ||
|
||||
0 < c // FE 1.0: smart cast impossible, see KT-10240
|
||||
) c = 0
|
||||
return c ?: 0
|
||||
}
|
||||
|
||||
var c: Int = 0
|
||||
c = 0
|
||||
return c
|
||||
}
|
||||
|
||||
fun myRun(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
|
||||
fun println(arg: Int) {}
|
||||
|
||||
fun d() {
|
||||
myRun {
|
||||
var koko: String? = "Alpha"
|
||||
while (koko != null) {
|
||||
println(koko.length)
|
||||
koko = null
|
||||
}
|
||||
}
|
||||
myRun {
|
||||
var koko: String? = "Omega"
|
||||
while (koko != null) {
|
||||
println(koko.length) // FE 1.0: smart cast impossible, see KT-19446
|
||||
koko = null
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user