Add tests for issues fixed in JVM IR and other obsolete issues

#KT-6007
 #KT-16445
 #KT-17753
 #KT-22488
 #KT-23881
 #KT-24135
 #KT-26360
 #KT-27427
 #KT-27449
 #KT-27830
 #KT-28042
 #KT-29595
 #KT-30708
 #KT-32793
This commit is contained in:
Alexander Udalov
2021-01-07 19:31:59 +01:00
parent 3e59adc7f3
commit 5480faf5c5
36 changed files with 824 additions and 0 deletions
@@ -0,0 +1,34 @@
// KT-27427
interface A {
fun foo()
}
class B : A {
override fun foo() {
}
}
fun test1() {
val b = B()
(b as A).foo()
}
fun test2() {
val b = getB()
(b as A).foo()
}
fun test3() {
val b = getB()
b.foo()
}
fun getB(): B = B()
// JVM_TEMPLATES
// 1 IFNONNULL
// There should be no null checks in the bytecode.
// JVM_IR_TEMPLATES
// 0 IFNONNULL