IR: make calls with explicit singleton receiver tailrec [KT-48602]

This commit is contained in:
Tianyu Geng
2021-09-03 15:31:30 -07:00
committed by TeamCityServer
parent 8525b4932b
commit 3c84fbcab1
14 changed files with 143 additions and 28 deletions
@@ -1,5 +1,6 @@
// FIR_IDENTICAL
object O {
// foo is the same, but the compiler currently doesn't compile this as tail recursive. See KT-48602
// tailrec since `O` is a singleton
tailrec fun foo(i: Int): Int = if (i < 0) 0 else O.foo(i - 1)
}