[FIR] Add test cases to prove resolution of backlog tickets

^KT-41728 Fixed
^KT-46586 Fixed
^KT-49696 Fixed
^KT-51160 Fixed
^KT-53308 Fixed
This commit is contained in:
Brian Norman
2023-11-07 10:12:13 -06:00
committed by Space Team
parent 2b82726f1d
commit 6df97dd199
15 changed files with 484 additions and 0 deletions
@@ -0,0 +1,10 @@
// WITH_STDLIB
// ISSUE: KT-41728
fun foo(a: String?) {
if (a == null) {
return
<!UNREACHABLE_CODE!>"hi".length<!>
}
a.length
}
@@ -0,0 +1,10 @@
// WITH_STDLIB
// ISSUE: KT-41728
fun foo(a: String?) {
if (a == null) {
return
<!UNREACHABLE_CODE!>"hi".length<!>
}
a<!UNSAFE_CALL!>.<!>length
}
@@ -0,0 +1,21 @@
// WITH_STDLIB
// ISSUE: KT-49696
interface Listener {
fun added(item: Any)
fun removed(item: Any)
}
val listeners = mutableListOf<Listener>()
fun smartCast(item: Any?) {
var current = item
if (current == null) {
current = Any()
listeners.forEach { it.added(current) }
} else {
listeners.forEach { it.removed(current) }
current = Any()
listeners.forEach { it.added(current) }
}
}
@@ -0,0 +1,21 @@
// WITH_STDLIB
// ISSUE: KT-49696
interface Listener {
fun added(item: Any)
fun removed(item: Any)
}
val listeners = mutableListOf<Listener>()
fun smartCast(item: Any?) {
var current = item
if (current == null) {
current = Any()
listeners.forEach { it.added(<!SMARTCAST_IMPOSSIBLE!>current<!>) }
} else {
listeners.forEach { it.removed(<!SMARTCAST_IMPOSSIBLE!>current<!>) }
current = Any()
listeners.forEach { it.added(<!DEBUG_INFO_SMARTCAST!>current<!>) }
}
}