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:
+34
@@ -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
|
||||
Reference in New Issue
Block a user