Fix usages of IGNORE_BACKEND_WITHOUT_CHECK

This commit is contained in:
Zalim Bashorov
2018-04-16 23:54:56 +03:00
parent ad2ea8f999
commit 09d5a0cb89
52 changed files with 79 additions and 58 deletions
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME
// WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
import helpers.*
import kotlin.coroutines.experimental.*
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JVM, JS, NATIVE
// IGNORE_BACKEND: JVM, JS, NATIVE
// WITH_RUNTIME
// WITH_COROUTINES
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun test(x : Int = 0, e : Any = "a") {
if (!e.equals("a")) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
open class A {
open fun foo(s: String = "OK") = s
@@ -1,6 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun Int.foo(x: Int) {
if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun noTails()<!> {
// nothing here
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun badTails(x : Int) : Int {
if (x < 50 && x != 10 && x > 0) {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
fun withoutAnnotation(x : Int) : Int {
if (x > 0) {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec infix fun Int.test(x : Int) : Int {
if (this > 1) {
@@ -1,6 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec infix fun Int.foo(x: Int) {
if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(counter : Int) : Int? {
if (counter < 0) return null
@@ -1,7 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
class B {
inner class C {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Int {
var z = if (x > 3) 3 else x
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Int {
if (x == 1) {
@@ -1,5 +1,5 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun <T, A> Iterator<T>.foldl(acc : A, foldFunction : (e : T, acc : A) -> A) : A =
if (!hasNext()) acc
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
fun escapeChar(c : Char) : String? = when (c) {
'\\' -> "\\\\"
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun String.repeat(num : Int, acc : StringBuilder = StringBuilder()) : String =
if (num == 0) acc.toString()
@@ -1,7 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun foo()<!> {
bar {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun foo()<!> {
fun bar() {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
fun test() {
tailrec fun g3(counter : Int) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Int {
return if (x == 1) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun foo(x: Int) {
if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Int =
if (x == 1) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Int {
if (x == 10) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Int {
if (x == 0) {
@@ -1,5 +1,5 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun sum(x: Long, sum: Long): Long {
if (x == 0.toLong()) return sum
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun foo(x: Int) {
return if (x > 0) {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun foo(x: Int) {
if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
<!NO_TAIL_CALLS_FOUND!>tailrec fun test(go: Boolean) : Unit<!> {
if (!go) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
class A {
tailrec fun f1(c : Int) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun test(x : Int) : Unit {
if (x == 1) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun withWhen(counter : Int) : Int =
when (counter) {
@@ -1,7 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun withWhen(counter : Int, d : Any) : Int =
when (counter) {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
tailrec fun withWhen(counter : Int, d : Any) : Int =
if (counter == 0) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// DONT_RUN_GENERATED_CODE: JS
// IGNORE_BACKEND: JS
tailrec fun withWhen2(counter : Int) : Int =
when {
@@ -6,7 +6,7 @@
// See KT-11258 Incorrect resolution sequence for Java field
// TODO: enable this test on JVM, see KT-16616
// IGNORE_BACKEND_WITHOUT_CHECK: JVM
// IGNORE_BACKEND: JVM
import java.util.*
@@ -1,2 +1,2 @@
// TODO: See KT-13618
// IGNORE_BACKEND_WITHOUT_CHECK: JS
// IGNORE_BACKEND: JS
@@ -8,7 +8,7 @@ public final class SecondaryConstructors public constructor(x: kotlin.Boolean) {
private constructor(x: kotlin.Int) { /* compiled code */ }
public final inner class Inner<T : kotlin.String, G : kotlin.Int> where G : java.io.Serializable {
public final inner class Inner<T : kotlin.String, G : kotlin.Int> where G : kotlin.Comparable<kotlin.Int> {
public constructor(x: T, g: G) { /* compiled code */ }
}
@@ -17,4 +17,8 @@ public final class SecondaryConstructors public constructor(x: kotlin.Boolean) {
internal constructor() { /* compiled code */ }
}
}
}
public final annotation class anno public constructor() : kotlin.Annotation {
}
@@ -1,7 +1,5 @@
package test
import java.io.Serializable
class SecondaryConstructors(x: Boolean) {
init {
}
@@ -15,7 +13,7 @@ class SecondaryConstructors(x: Boolean) {
private constructor(x: Int) : this(x < 0) {
}
inner class Inner<T : String, G : Int> where G : Serializable {
inner class Inner<T : String, G : Int> where G : Comparable<Int> {
constructor(x: T, g: G) {
}
}
@@ -1,4 +0,0 @@
// TODO Remove this restriction when secondary constructors will be supported in js backend.
// See KT-7798 JS: add support for secondary constructors
// https://youtrack.jetbrains.com/issue/KT-7798
// IGNORE_BACKEND_WITHOUT_CHECK: JS