[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
@@ -0,0 +1,33 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
fun foo() {
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?): Any? = null
@nativeSetter
fun Int.set3(a: Double, v: String) = "OK"
@nativeSetter
fun Int.set4(a: Double, v: String): Any = 1
@nativeSetter
fun Int.set5(a: Double, v: String): CharSequence = "OK"
@nativeSetter
fun Int.set6(a: Double, v: String): Number = 1
@nativeSetter
fun Int.set(a: Any): Int? = 1
@nativeSetter
fun Int.set2(): String? = "OK"
@nativeSetter
fun Int.set3(a: Any, b: Int, c: Any?) {}
@nativeSetter
fun Any.foo(a: Double = 0.0, v: String? = null) = "OK"
}
@@ -0,0 +1,45 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -NON_TOPLEVEL_CLASS_DECLARATION, -DEPRECATION
fun foo() {
class A {
@nativeSetter
fun set(a: String, v: Any?): Any? = null
@nativeSetter
fun put(a: Number, v: String) {}
@nativeSetter
fun foo(a: Int, v: String) {}
}
class B {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
var foo = 0
}
class C {
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?) = "OK"
@nativeSetter
fun Int.set3(a: Double, v: String?) = "OK"
@nativeSetter
fun set(): Any? = null
@nativeSetter
fun set(a: A): Any? = null
@nativeSetter
fun set(a: String, v: Any, v2: Any) {}
@nativeSetter
fun set(a: A, v: Any?) {}
@nativeSetter
fun foo(a: Int = 0, v: String) = "OK"
}
}
@@ -0,0 +1,12 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION, -DEPRECATION
fun foo() {
@nativeSetter
fun toplevelFun(): Any = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val toplevelVal = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
class Foo {}
}
@@ -0,0 +1,71 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
external class A {
@nativeSetter
fun set(a: String, v: Any?): Any? = definedExternally
@nativeSetter
fun put(a: Number, v: String) { definedExternally }
@nativeSetter
fun foo(a: Int, v: String) { definedExternally }
@nativeSetter
fun set4(a: Double, v: String): Any = definedExternally
@nativeSetter
fun set5(a: Double, v: String): CharSequence = definedExternally
companion object {
@nativeSetter
fun set(a: String, v: Any?): Any? = definedExternally
@nativeSetter
fun put(a: Number, v: String) { definedExternally }
@nativeSetter
fun foo(a: Int, v: String) { definedExternally }
@nativeSetter
fun set4(a: Double, v: String): Any = definedExternally
@nativeSetter
fun set5(a: Double, v: String): CharSequence = definedExternally
}
}
external class B {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo: Int = definedExternally
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj1 {}
companion object {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo: Int = definedExternally
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj2 {}
}
}
external class C {
@nativeSetter
fun set6(a: Double, v: String): Number = definedExternally
@nativeSetter
fun set(): Any? = definedExternally
@nativeSetter
fun set(a: A): Any? = definedExternally
@nativeSetter
fun set(a: String, v: Any, v2: Any) { definedExternally }
@nativeSetter
fun set(a: A, v: Any?) { definedExternally }
@nativeSetter
fun foo(a: Number, v: String = definedExternally): String = definedExternally
}
@@ -0,0 +1,92 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
external class A {
class B {
class A {
@nativeSetter
fun set(a: String, v: Any?): Any? = definedExternally
@nativeSetter
fun put(a: Number, v: String) { definedExternally }
@nativeSetter
fun foo(a: Int, v: String) { definedExternally }
@nativeSetter
fun set4(a: Double, v: String): Any = definedExternally
@nativeSetter
fun set5(a: Double, v: String): CharSequence = definedExternally
companion object {
@nativeSetter
fun set(a: String, v: Any?): Any? = definedExternally
@nativeSetter
fun put(a: Number, v: String) { definedExternally }
@nativeSetter
fun foo(a: Int, v: String) { definedExternally }
@nativeSetter
fun set4(a: Double, v: String): Any = definedExternally
@nativeSetter
fun set5(a: Double, v: String): CharSequence = definedExternally
}
}
class B {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo: Int = definedExternally
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj1 {}
companion object {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo: Int = definedExternally
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj2 {}
}
}
class C {
@nativeSetter
fun set6(a: Double, v: String): Number = definedExternally
@nativeSetter
fun set(): Any? = definedExternally
@nativeSetter
fun set(a: A): Any? = definedExternally
@nativeSetter
fun set(a: String, v: Any, v2: Any) { definedExternally }
@nativeSetter
fun set(a: A, v: Any?) { definedExternally }
@nativeSetter
fun foo(a: Double = definedExternally, v: String = definedExternally): String = definedExternally
}
object obj {
@nativeSetter
fun set(): Any? = definedExternally
@nativeSetter
fun set(a: A): Any? = definedExternally
@nativeSetter
fun set(a: String, v: Any, v2: Any) { definedExternally }
@nativeSetter
fun set(a: A, v: Any?) { definedExternally }
@nativeSetter
fun foo(a: Int, v: String = definedExternally): String = definedExternally
}
}
}
@@ -0,0 +1,130 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -NON_TOPLEVEL_CLASS_DECLARATION, -DEPRECATION
class A {
class B {
class A {
@nativeSetter
fun set(a: String, v: Any?): Any? = null
@nativeSetter
fun put(a: Number, v: String) {}
@nativeSetter
fun foo(a: Int, v: String) {}
@nativeSetter
fun set4(a: Double, v: String): Any = 1
@nativeSetter
fun set5(a: Double, v: String): CharSequence = "OK"
companion object {
@nativeSetter
fun set(a: String, v: Any?): Any? = null
@nativeSetter
fun put(a: Number, v: String) {}
@nativeSetter
fun foo(a: Int, v: String) {}
}
}
class B {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj1 {}
companion object {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj2 {}
}
}
class C {
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?) = "OK"
@nativeSetter
fun Int.set3(a: Double, v: String?) = "OK"
@nativeSetter
fun Int.set6(a: Double, v: String): Number = 1
@nativeSetter
fun set(): Any? = null
@nativeSetter
fun set(a: A): Any? = null
@nativeSetter
fun set(a: String, v: Any, v2: Any) {}
@nativeSetter
fun set(a: A, v: Any?) {}
@nativeSetter
fun foo(a: Double = 0.0, v: String = "str") = "OK"
}
object obj {
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?) = "OK"
@nativeSetter
fun Int.set3(a: Double, v: String?) = "OK"
@nativeSetter
fun set(): Any? = null
@nativeSetter
fun set(a: A): Any? = null
@nativeSetter
fun set(a: String, v: Any, v2: Any) {}
@nativeSetter
fun set(a: A, v: Any?) {}
@nativeSetter
fun foo(a: Int, v: String = "str") = "OK"
}
val anonymous = object {
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?) = "OK"
@nativeSetter
fun Int.set3(a: Double, v: String?) = "OK"
@nativeSetter
fun set(): Any? = null
@nativeSetter
fun set(a: A): Any? = null
@nativeSetter
fun set(a: String, v: Any, v2: Any) {}
@nativeSetter
fun set(a: A, v: Any?) {}
@nativeSetter
fun foo(a: Number = 0.0, v: String) = "OK"
}
}
}
@@ -0,0 +1,65 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
class A {
@nativeSetter
fun set(a: String, v: Any?): Any? = null
@nativeSetter
fun put(a: Number, v: String) {}
@nativeSetter
fun foo(a: Int, v: String) {}
companion object {
@nativeSetter
fun set(a: String, v: Any?): Any? = null
@nativeSetter
fun put(a: Number, v: String) {}
@nativeSetter
fun foo(a: Int, v: String) {}
}
}
class B {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj1 {}
companion object {
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val foo = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
object Obj2 {}
}
}
class C {
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?) = "OK"
@nativeSetter
fun Int.set3(a: Double, v: String?) = "OK"
@nativeSetter
fun set(): Any? = null
@nativeSetter
fun set(a: A): Any? = null
@nativeSetter
fun set(a: String, v: Any, v2: Any) {}
@nativeSetter
fun set(a: A, v: Any?) {}
@nativeSetter
fun foo(a: String = "0.0", v: String) = "OK"
}
@@ -0,0 +1,31 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
@nativeSetter
fun Int.set(a: String, v: Int) {}
@nativeSetter
fun Int.set2(a: Number, v: String?): Any? = null
@nativeSetter
fun Int.set3(a: Double, v: String) = "OK"
@nativeSetter
fun Int.set4(a: Double, v: String): Any = 1
@nativeSetter
fun Int.set5(a: Double, v: String): CharSequence = "OK"
@nativeSetter
fun Int.set6(a: Double, v: String): Number = 1
@nativeSetter
fun Any.foo(a: String = "0.0", v: String = "str") = "OK"
@nativeSetter
fun Int.set(a: <!UNRESOLVED_REFERENCE!>A<!>): Int? = 1
@nativeSetter
fun Int.set2(): String? = "OK"
@nativeSetter
fun Int.set3(a: Any, b: Int, c: Any?) {}
@@ -0,0 +1,10 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER, -DEPRECATION
@nativeSetter
fun toplevelFun(): Any = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
val toplevelVal = 0
<!WRONG_ANNOTATION_TARGET!>@nativeSetter<!>
class Foo {}