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_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // WITH_COROUTINES
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
import helpers.* import helpers.*
import kotlin.coroutines.experimental.* import kotlin.coroutines.experimental.*
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JVM, JS, NATIVE // IGNORE_BACKEND: JVM, JS, NATIVE
// WITH_RUNTIME // WITH_RUNTIME
// WITH_COROUTINES // 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") { tailrec fun test(x : Int = 0, e : Any = "a") {
if (!e.equals("a")) { if (!e.equals("a")) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 class A {
open fun foo(s: String = "OK") = s open fun foo(s: String = "OK") = s
@@ -1,6 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
tailrec fun Int.foo(x: Int) { tailrec fun Int.foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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()<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun noTails()<!> {
// nothing here // nothing here
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun badTails(x : Int) : Int {
if (x < 50 && x != 10 && x > 0) { 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 { fun withoutAnnotation(x : Int) : Int {
if (x > 0) { 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 { tailrec infix fun Int.test(x : Int) : Int {
if (this > 1) { if (this > 1) {
@@ -1,6 +1,6 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
tailrec infix fun Int.foo(x: Int) { tailrec infix fun Int.foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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? { tailrec fun test(counter : Int) : Int? {
if (counter < 0) return null if (counter < 0) return null
@@ -1,7 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { class B {
inner class C { inner class C {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun test(x : Int) : Int {
var z = if (x > 3) 3 else x var z = if (x > 3) 3 else x
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun test(x : Int) : Int {
if (x == 1) { if (x == 1) {
@@ -1,5 +1,5 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 = tailrec fun <T, A> Iterator<T>.foldl(acc : A, foldFunction : (e : T, acc : A) -> A) : A =
if (!hasNext()) acc if (!hasNext()) acc
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
fun escapeChar(c : Char) : String? = when (c) { 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 = tailrec fun String.repeat(num : Int, acc : StringBuilder = StringBuilder()) : String =
if (num == 0) acc.toString() if (num == 0) acc.toString()
@@ -1,7 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not // 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()<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun foo()<!> {
bar { bar {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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()<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun foo()<!> {
fun bar() { fun bar() {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
fun test() { fun test() {
tailrec fun g3(counter : Int) { tailrec fun g3(counter : Int) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun test(x : Int) : Int {
return if (x == 1) { return if (x == 1) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0 if (counter == 0) return 0
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0 if (counter == 0) return 0
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0 if (counter == 0) return 0
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
tailrec fun foo(x: Int) { tailrec fun foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun test(counter : Int) : Int<!> {
if (counter == 0) return 0 if (counter == 0) return 0
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 = tailrec fun test(x : Int) : Int =
if (x == 1) { if (x == 1) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun test(x : Int) : Int {
if (x == 10) { if (x == 10) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun test(x : Int) : Int {
if (x == 0) { if (x == 0) {
@@ -1,5 +1,5 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun sum(x: Long, sum: Long): Long {
if (x == 0.toLong()) return sum 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) { tailrec fun foo(x: Int) {
return if (x > 0) { return if (x > 0) {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
tailrec fun foo(x: Int) { tailrec fun foo(x: Int) {
if (x == 0) return if (x == 0) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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<!> { <!NO_TAIL_CALLS_FOUND!>tailrec fun test(go: Boolean) : Unit<!> {
if (!go) return if (!go) return
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { class A {
tailrec fun f1(c : Int) { tailrec fun f1(c : Int) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 { tailrec fun test(x : Int) : Unit {
if (x == 1) { if (x == 1) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 = tailrec fun withWhen(counter : Int) : Int =
when (counter) { when (counter) {
@@ -1,7 +1,8 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// TODO: muted automatically, investigate should it be ran for JS or not // 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 = tailrec fun withWhen(counter : Int, d : Any) : Int =
when (counter) { when (counter) {
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_WITHOUT_CHECK: JS // DONT_RUN_GENERATED_CODE: JS
tailrec fun withWhen(counter : Int, d : Any) : Int = tailrec fun withWhen(counter : Int, d : Any) : Int =
if (counter == 0) { if (counter == 0) {
@@ -1,5 +1,6 @@
// TODO: muted automatically, investigate should it be ran for JS or not // 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 = tailrec fun withWhen2(counter : Int) : Int =
when { when {
@@ -6,7 +6,7 @@
// See KT-11258 Incorrect resolution sequence for Java field // See KT-11258 Incorrect resolution sequence for Java field
// TODO: enable this test on JVM, see KT-16616 // TODO: enable this test on JVM, see KT-16616
// IGNORE_BACKEND_WITHOUT_CHECK: JVM // IGNORE_BACKEND: JVM
import java.util.* import java.util.*
@@ -1,2 +1,2 @@
// TODO: See KT-13618 // 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 */ } 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 */ } 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 */ } internal constructor() { /* compiled code */ }
} }
} }
public final annotation class anno public constructor() : kotlin.Annotation {
}
@@ -1,7 +1,5 @@
package test package test
import java.io.Serializable
class SecondaryConstructors(x: Boolean) { class SecondaryConstructors(x: Boolean) {
init { init {
} }
@@ -15,7 +13,7 @@ class SecondaryConstructors(x: Boolean) {
private constructor(x: Int) : this(x < 0) { 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) { 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