JVM_IR: Backwards compatible handling of default tailrec params.

Before 1.4 tailrec function default arguments were evaluated
right-to-left instead of left-to-right. This is controlled
by a compile-time flag. This change adds support for the
right-to-left evaluation order when that flag is not set.
This commit is contained in:
Mads Ager
2019-12-16 14:16:14 +01:00
committed by max-kammerer
parent 90a1b15b77
commit 82f48cdd11
4 changed files with 59 additions and 33 deletions
@@ -1,7 +1,5 @@
// !LANGUAGE: -ProperComputationOrderOfTailrecDefaultParameters
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// IGNORE_BACKEND: JVM_IR
var counter = 0
fun calc(counter: Int) = if (counter % 2 == 0) "K" else "O"