Use codegen box tests for tail calls as diagnostic tests too
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
tailRecursive fun test(x : Int, a : Any) : Int {
|
||||
if (x == 1) {
|
||||
if (x != 1) {
|
||||
test(0, "no tail")
|
||||
<!NON_TAIL_RECURSIVE_CALL!>test<!>(0, "no tail")
|
||||
return test(0, "tail")
|
||||
} else {
|
||||
return test(x + test(0, "no tail"), "tail")
|
||||
return test(x + <!NON_TAIL_RECURSIVE_CALL!>test<!>(0, "no tail"), "tail")
|
||||
}
|
||||
} else if (x > 0) {
|
||||
return test(x - 1, "tail")
|
||||
|
||||
Reference in New Issue
Block a user