[IR] Not try Null constant in fold constant

^KT-46859 fixed
This commit is contained in:
Ilya Goncharov
2021-05-21 19:29:06 +03:00
committed by teamcityserver
parent b18d4af37b
commit c62a965180
10 changed files with 81 additions and 0 deletions
@@ -0,0 +1,33 @@
fun box(): String {
return "OK"
}
fun foo() {
foldingUnary(null)
foldingBinary(null, null)
foldingBuiltinBinary(null, null)
}
class Foo {
fun foo() {}
fun foo(foo: Foo?) {}
}
inline fun foldingUnary(foo: Foo?) {
foo!!
foo.foo()
}
inline fun foldingBinary(foo1: Foo?, foo2: Foo?) {
foo1!!
foo2!!
foo1.foo(foo2)
}
inline fun foldingBuiltinBinary(int1: Int?, int2: Int?) {
int1!!
int2!!
int1 < int2
}