All tests for TCO moved to box (with diagnostics marked up)
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
tailRecursive fun Int.foo(x: Int) {
|
||||
return 1.foo(2)
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun noTails()<!> {
|
||||
// nothing here
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
tailRecursive fun badTails(x : Int) : Int {
|
||||
if (x > 0) {
|
||||
return 1 + <!NON_TAIL_RECURSIVE_CALL!>badTails<!>(x - 1)
|
||||
}
|
||||
else if (x == 10) {
|
||||
[suppress("NON_TAIL_RECURSIVE_CALL")]
|
||||
return 1 + badTails(x - 1)
|
||||
} else if (x == 50) {
|
||||
return badTails(x - 1)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
fun withoutAnnotation(x : Int) : Int {
|
||||
if (x > 0) {
|
||||
return 1 + withoutAnnotation(x - 1)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
tailRecursive fun Int.foo(x: Int) {
|
||||
return 1 foo 2
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun foo()<!> {
|
||||
run {
|
||||
<!NON_TAIL_RECURSIVE_CALL!>foo<!>()
|
||||
}
|
||||
}
|
||||
|
||||
fun run(a: Any) {}
|
||||
@@ -1,5 +0,0 @@
|
||||
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun foo()<!> {
|
||||
fun bar() {
|
||||
<!NON_TAIL_RECURSIVE_CALL!>foo<!>()
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
tailRecursive fun foo() {
|
||||
(return foo())
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
tailRecursive fun foo() {
|
||||
return if (true) {
|
||||
(foo())
|
||||
}
|
||||
else Unit.VALUE
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
tailRecursive fun foo() {
|
||||
return (foo())
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<!NO_TAIL_CALLS_FOUND!>tailRecursive fun test() : Unit<!> {
|
||||
try {
|
||||
<!TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED!>test<!>()
|
||||
} catch (any : Exception) {
|
||||
<!TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED!>test<!>()
|
||||
} finally {
|
||||
<!TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED!>test<!>()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user