[FIR JS] Prepare the test data for FIR

This commit is contained in:
Nikolay Lunyak
2023-01-03 13:24:08 +02:00
committed by Space Team
parent 0e38d0ebd2
commit 73c89a5d9d
181 changed files with 3790 additions and 10 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
@@ -0,0 +1,22 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
package foo
class C1 {
@JsExport
fun f1() {}
@JsExport
val p: Int = 10
@JsExport
object O
}
fun f2() {
@JsExport
fun f3() {}
@JsExport
class C2
}
@@ -0,0 +1,46 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
package foo
@JsExport
fun delete() {}
@JsExport
val instanceof = 4
@JsExport
class eval
@JsExport
@JsName("await")
fun foo() {}
@JsExport
@JsName("this")
val bar = 4
@JsExport
@JsName("super")
class Baz
@JsExport
@JsName("default")
class DefDef
@JsExport
class Test {
fun instanceof() {}
@JsName("eval")
fun test() {}
}
@JsExport
object NaN
@JsExport
enum class Nums {
Infinity,
undefined
}
@@ -0,0 +1,34 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
@file:JsExport
package foo
fun delete() {}
val instanceof = 4
class eval
@JsName("await")
fun foo() {}
@JsName("this")
val bar = 4
@JsName("super")
class Baz
class Test {
fun instanceof() {}
@JsName("eval")
fun test() {}
}
object NaN
enum class Nums {
Infinity,
undefined
}
@@ -0,0 +1,15 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
package foo
@JsExport
class C(val x: String) {
constructor(x: Int): this(x.toString())
}
@JsExport
class C2(val x: String) {
@JsName("JsNameProvided")
constructor(x: Int): this(x.toString())
}
@@ -0,0 +1,14 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
@file:JsExport
package foo
class C(val x: String) {
constructor(x: Int): this(x.toString())
}
class C2(val x: String) {
@JsName("JsNameProvided")
constructor(x: Int): this(x.toString())
}
@@ -0,0 +1,56 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !RENDER_DIAGNOSTICS_MESSAGES
package foo
class C
@JsExport
fun foo(x: C) {
}
@JsExport
fun bar() = C()
@JsExport
val x: C = C()
@JsExport
var x2: C
get() = C()
set(value) { }
@JsExport
class A(
val x: C,
y: C
) {
fun foo(x: C) = x
val x2: C = C()
var x3: C
get() = C()
set(value) { }
}
@JsExport
fun foo2() {
}
@JsExport
fun foo3(x: Unit) {
}
@JsExport
fun foo4(x: () -> Unit) {
}
@JsExport
fun foo5(x: (Unit) -> Unit) {
}
@JsExport
fun foo6(x: (A) -> A) {
}
@@ -0,0 +1,25 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !RENDER_DIAGNOSTICS_MESSAGES
package foo
abstract class C
interface I
@JsExport
fun <T : C>foo() { }
@JsExport
class A<T : C, S: I>
@JsExport
interface I2<T> where T : C, T : I
@JsExport
class B<T>(val a: T, val b: Comparable<T>) {
val c: Comparable<T> = b
}
@JsExport
class D<T>(val a: T, val b: Array<T>)
@@ -0,0 +1,48 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
// !DIAGNOSTICS: -INLINE_CLASS_DEPRECATED
package foo
@JsExport
inline fun <reified T> inlineReifiedFun(x: Any) = x is T
@JsExport
suspend fun suspendFun() { }
@JsExport
val String.extensionProperty
get() = this.length
@JsExport
annotation class AnnotationClass
@JsExport
interface SomeInterface
@JsExport
external interface GoodInterface
@JsExport
interface InterfaceWithCompanion {
companion object {
fun foo() = 42
}
}
@JsExport
interface OuterInterface {
class Nested
}
@JsExport
value class A(val a: Int)
@JsExport
inline class B(val b: Int)
@JsExport
inline value class C(val c: Int)
@JsExport
value inline class D(val d: Int)
@@ -0,0 +1,15 @@
// !OPT_IN: kotlin.js.ExperimentalJsExport
// !RENDER_DIAGNOSTICS_MESSAGES
@file:JsExport
package foo
inline fun <reified T> inlineReifiedFun(x: Any) = x is T
suspend fun suspendFun() { }
val String.extensionProperty
get() = this.length
annotation class AnnotationClass