Analysis API: move testdata to corresponding components folders

This commit is contained in:
Ilya Kirillov
2021-11-17 18:42:35 +01:00
parent f833fc4bcb
commit 6f6a33e852
533 changed files with 0 additions and 0 deletions
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
<expr>@AnnotationInner(Annotation("v1", "v2"))</expr>
class C
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { Annotation("v1", "v2") -> (value: Annotation) }
targetFunction = <constructor>(value: Annotation): AnnotationInner
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation(strings = arrayOf("v1", "v2"))</expr>)
class C
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { arrayOf("v1", "v2") -> (vararg strings: kotlin.String) }
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
substitutor = <empty substitutor>
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation(["v1", "v2"])</expr>)
class C
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { ["v1", "v2"] -> (vararg strings: kotlin.String) }
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
substitutor = <empty substitutor>
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationArray(vararg val annos: Annotation)
@AnnotationArray(<expr>annos = arrayOf(Annotation("v1", "v2"), Annotation(strings = arrayOf("v3", "v4")))</expr>)
class C
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { Annotation("v1", "v2") -> (vararg elements: Annotation), Annotation(strings = arrayOf("v3", "v4")) -> (vararg elements: Annotation) }
targetFunction = kotlin/arrayOf(vararg elements: Annotation): kotlin.Array<Annotation>
substitutor = <map substitutor: {T = Annotation}>
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationArray(vararg val annos: Annotation)
<expr>@AnnotationArray([Annotation("v1", "v2"), Annotation(["v3", "v4"])])</expr>
class C
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { [Annotation("v1", "v2"), Annotation(["v3", "v4"])] -> (vararg annos: Annotation) }
targetFunction = <constructor>(vararg annos: Annotation): AnnotationArray
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation()</expr>)
class C
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { }
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
substitutor = <empty substitutor>
@@ -0,0 +1,6 @@
annotation class Annotation(vararg val strings: String)
annotation class AnnotationInner(val value: Annotation)
@AnnotationInner(<expr>Annotation("v1", "v2")</expr>)
class C
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { "v1" -> (vararg strings: kotlin.String), "v2" -> (vararg strings: kotlin.String) }
targetFunction = <constructor>(vararg strings: kotlin.String): Annotation
substitutor = <empty substitutor>
@@ -0,0 +1,2 @@
<expr>@delegate:Suppress</expr>
val annotatedDelegate by lazy { 1 + 1 }
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
@@ -0,0 +1,8 @@
class A<T>(val value : T)
class B<T>
fun <T> A<T>.toB(): B<T> {
<expr>@Suppress("UNCHECKED_CAST")</expr>
val v = (value as? Long)?.let { it.toInt() } as T ?: value
return v
}
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) }
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
@@ -0,0 +1,4 @@
fun foo(data: Any) {
<expr>@Suppress("UNCHECKED_CAST")</expr>
val (k, v) = data as Pair<String, String>
}
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { "UNCHECKED_CAST" -> (vararg names: kotlin.String) }
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
@@ -0,0 +1,3 @@
val a: Int = 42
val b: Int = 24
val c = <expr>@Suppress</expr> if (a > 2) a else b
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
@@ -0,0 +1,7 @@
fun annotatedSwitch(str: String) =
when {
<expr>@Suppress("DEPRECATION")</expr>
str.isBlank() -> null
str.isNotEmpty() != null -> null
else -> 1
}
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { "DEPRECATION" -> (vararg names: kotlin.String) }
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
@@ -0,0 +1,6 @@
// WITH_STDLIB
<expr>@file:JvmName("Foo")</expr>
package some.pkg
val p : Int = 42
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { "Foo" -> (name: kotlin.String) }
targetFunction = <constructor>(name: kotlin.String): kotlin.jvm.JvmName
@@ -0,0 +1,3 @@
annotation class Anno
class Test1(<expr>@param:Anno</expr> var bar: Int)
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,3 @@
annotation class Anno
class Test1(<expr>@Anno</expr> var bar: Int)
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1 @@
inline fun <reified T> functionWithParamAnnotation(<expr>@Suppress("s")</expr> t: T): T = t
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { "s" -> (vararg names: kotlin.String) }
targetFunction = <constructor>(vararg names: kotlin.String): kotlin.Suppress
@@ -0,0 +1,3 @@
annotation class Anno
class Test1(<expr>@setparam:Anno</expr> var bar: Int)
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,9 @@
annotation class Anno
<expr>@field:Anno</expr>
var p : Int = 42
set(value) {
if (value > field) {
field = value
}
}
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,4 @@
annotation class Anno
<expr>@get:Anno</expr>
val p : Int = 42
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,4 @@
annotation class Anno
<expr>@property:Anno</expr>
val p : Int = 42
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,4 @@
annotation class Anno
<expr>@set:Anno</expr>
var p : Int = 42
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,6 @@
annotation class Anno
<expr>@receiver:Anno</expr>
fun String.foo() {
return "$this (${this.length})"
}
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { }
targetFunction = <constructor>(): Anno
@@ -0,0 +1,4 @@
annotation class RequiresPermission(val anyOf: IntArray)
@RequiresPermission(anyOf = <expr>arrayOf(1, 2, 3)</expr>)
fun foo(): Int = 5
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (vararg elements: kotlin.Int), 2 -> (vararg elements: kotlin.Int), 3 -> (vararg elements: kotlin.Int) }
targetFunction = kotlin/arrayOf(vararg elements: kotlin.Int): kotlin.Array<kotlin.Int>
substitutor = <map substitutor: {T = kotlin/Int}>
@@ -0,0 +1,9 @@
class Base(
val p1: Int
)
class Sub(
override val p1: Int
) : Base(p1) {
constructor(i : Int, j : Int) : <expr>super(i + j)</expr>
}
@@ -0,0 +1,4 @@
KtDelegatedConstructorCall:
argumentMapping = { i + j -> (p1: kotlin.Int) }
targetFunction = <constructor>(p1: kotlin.Int): Base
kind = SUPER_CALL
@@ -0,0 +1,4 @@
KtDelegatedConstructorCall:
argumentMapping = { s -> (p1: kotlin.Int) }
targetFunction = ERR<Unresolved call, [<constructor>(p1: kotlin.Int): Base]>
kind = SUPER_CALL
@@ -0,0 +1,9 @@
class Base(
val p1: Int
)
class Sub(
p: Int
) : Base(p), Unresolved {
constructor(s: String) : <expr>super(s)</expr>
}
@@ -0,0 +1,4 @@
KtDelegatedConstructorCall:
argumentMapping = { s -> (p1: kotlin.Int) }
targetFunction = ERR<Argument type mismatch: actual type is kotlin/String but kotlin/Int was expected, [<constructor>(p1: kotlin.Int): Base]>
kind = SUPER_CALL
@@ -0,0 +1,9 @@
class Base(
val p1: Int
)
class Sub(
override val p1: Int
) : Base(p1) {
constructor(s: String) : <expr>this(s.length)</expr>
}
@@ -0,0 +1,4 @@
KtDelegatedConstructorCall:
argumentMapping = { s.length -> (p1: kotlin.Int) }
targetFunction = <constructor>(p1: kotlin.Int): Sub
kind = THIS_CALL
@@ -0,0 +1,4 @@
KtDelegatedConstructorCall:
argumentMapping = { }
targetFunction = ERR<Unresolved call, []>
kind = THIS_CALL
@@ -0,0 +1,9 @@
class Base(
val p1: Int
)
class Sub(
p: Int
) : Base(p), Unresolved {
constructor(i : Int, j : Int) : <expr>this(i, j, i * j)</expr>
}
@@ -0,0 +1,4 @@
KtDelegatedConstructorCall:
argumentMapping = { }
targetFunction = ERR<None of the following functions are applicable: [/Sub.Sub, /Sub.Sub], [<constructor>(p: kotlin.Int): Sub, <constructor>(i: kotlin.Int, j: kotlin.Int): Sub]>
kind = THIS_CALL
@@ -0,0 +1,10 @@
enum class Color {
R,
G,
B
}
annotation class Annotation(val color : Color)
<expr>@Annotation(Color.R)</expr>
class C
@@ -0,0 +1,3 @@
KtAnnotationCall:
argumentMapping = { Color.R -> (color: Color) }
targetFunction = <constructor>(color: Color): Annotation
@@ -0,0 +1,5 @@
fun function(a: Int) {}
fun call() {
<expr>function(1)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = /function(a: kotlin.Int): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
fun <A, B> A.function(a: B) {}
fun call() {
"str".<expr>function(1)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = /function(<extension receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
substitutor = <map substitutor: {A = kotlin/String, B = kotlin/Int}>
@@ -0,0 +1,5 @@
fun function(a: Int, b: (String) -> Boolean) {}
fun call() {
<expr>function(1) { s -> true }</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), { s -> true } -> (b: kotlin.Function1<kotlin.String, kotlin.Boolean>) }
targetFunction = /function(a: kotlin.Int, b: kotlin.Function1<kotlin.String, kotlin.Boolean>): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
fun function(a: Int, b: String) {}
fun call() {
<expr>function(b = "foo", a = 1)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { "foo" -> (b: kotlin.String), 1 -> (a: kotlin.Int) }
targetFunction = /function(a: kotlin.Int, b: kotlin.String): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
fun function(a: Int, b: (String) -> Boolean) {}
fun call() {
<expr>function(1, { s -> true })</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), { s -> true } -> (b: kotlin.Function1<kotlin.String, kotlin.Boolean>) }
targetFunction = /function(a: kotlin.Int, b: kotlin.Function1<kotlin.String, kotlin.Boolean>): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,6 @@
fun function(vararg a: Int) {}
fun call() {
val args = intArrayOf(1, 2, 3)
<expr>function(*args)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { args -> (vararg a: kotlin.Int) }
targetFunction = /function(vararg a: kotlin.Int): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
fun <A, B> function(a: A, b: B) {}
fun call() {
<expr>function(1, "")</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "" -> (b: kotlin.String) }
targetFunction = /function(a: kotlin.Int, b: kotlin.String): kotlin.Unit
substitutor = <map substitutor: {A = kotlin/Int, B = kotlin/String}>
@@ -0,0 +1,5 @@
fun function(vararg a: Int) {}
fun call() {
<expr>function(1, 2, 3)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (vararg a: kotlin.Int), 2 -> (vararg a: kotlin.Int), 3 -> (vararg a: kotlin.Int) }
targetFunction = /function(vararg a: kotlin.Int): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
fun String.function(a: Int) {}
fun call() {
"str".<expr>function(1)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = /function(<extension receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
fun String.function(a: Int) {}
fun call() {
"str"?.<expr>function(1)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = /function(<extension receiver>: kotlin.String, a: kotlin.Int): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class A {
constructor(i: Int)
}
fun call() {
val a = <expr>A(42)</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 42 -> (i: kotlin.Int) }
targetFunction = <constructor>(i: kotlin.Int): A
substitutor = <empty substitutor>
@@ -0,0 +1,5 @@
class A
fun call() {
val a = <expr>A()</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { }
targetFunction = <constructor>(): A
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
// FILE: call.kt
fun call() {
val a = <expr>A()</expr>
}
// FILE: A.java
class A {}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { }
targetFunction = <constructor>(): A
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class C {
operator fun get(a: Int, b: String): Boolean = true
}
fun call(c: C) {
val res = <expr>c[1, "foo"]</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) }
targetFunction = /C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean
substitutor = <empty substitutor>
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = ERR<Unresolved call, [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class C {
operator fun get(a: Int, b: String): Boolean = true
}
fun call(c: C) {
val res = <expr>c[1]</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int) }
targetFunction = ERR<No value passed for parameter 'b', [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
substitutor = <empty substitutor>
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) }
targetFunction = ERR<Unresolved call, [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class C {
operator fun get(a: Int, b: String): Boolean = true
}
fun call(c: C) {
val res = <expr>c[1, "foo", false]</expr>
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String) }
targetFunction = ERR<Too many arguments for public final operator fun /C.get(a: R|kotlin/Int|, b: R|kotlin/String|): R|kotlin/Boolean|, [/C.get(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String): kotlin.Boolean]>
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class C {
operator fun set(a: Int, b: String, value: Boolean) {}
}
fun call(c: C) {
<expr>c[1, "foo"]</expr> = false
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String), false -> (value: kotlin.Boolean) }
targetFunction = /C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit
substitutor = <empty substitutor>
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), false -> (value: kotlin.Boolean) }
targetFunction = ERR<Unresolved call, [/C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]>
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class C {
operator fun set(a: Int, b: String, value: Boolean) {}
}
fun call(c: C) {
<expr>c[1]</expr> = false
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), false -> (value: kotlin.Boolean) }
targetFunction = ERR<No value passed for parameter 'b', [/C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]>
substitutor = <empty substitutor>
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String), 3.14 -> (value: kotlin.Boolean) }
targetFunction = ERR<Unresolved call, [/C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]>
substitutor = <empty substitutor>
@@ -0,0 +1,7 @@
class C {
operator fun set(a: Int, b: String, value: Boolean) {}
}
fun call(c: C) {
<expr>c[1, "foo", 3.14]</expr> = false
}
@@ -0,0 +1,4 @@
KtFunctionCall:
argumentMapping = { 1 -> (a: kotlin.Int), "foo" -> (b: kotlin.String), false -> (value: kotlin.Boolean) }
targetFunction = ERR<Too many arguments for public final operator fun /C.set(a: R|kotlin/Int|, b: R|kotlin/String|, value: R|kotlin/Boolean|): R|kotlin/Unit|, [/C.set(<dispatch receiver>: C, a: kotlin.Int, b: kotlin.String, value: kotlin.Boolean): kotlin.Unit]>
substitutor = <empty substitutor>

Some files were not shown because too many files have changed in this diff Show More