Analysis API: move testdata to corresponding components folders
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
open class A
|
||||
|
||||
|
||||
class B : A
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
open class A
|
||||
class B : A
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
abstract class A {
|
||||
abstract class Nested
|
||||
}
|
||||
|
||||
typealias TA = A
|
||||
|
||||
class B : TA() {
|
||||
class NestedInB : Nested()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
abstract class A {
|
||||
abstract class Nested
|
||||
}
|
||||
typealias TA = A
|
||||
class B : TA {
|
||||
class NestedInB : A.Nested
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package p
|
||||
|
||||
abstract class My {
|
||||
abstract class NestedOne : My() {
|
||||
abstract class NestedTwo : NestedOne() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Your : My() {
|
||||
class NestedThree : NestedOne()
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
abstract class My {
|
||||
abstract class NestedOne : My {
|
||||
abstract class NestedTwo : My.NestedOne
|
||||
}
|
||||
}
|
||||
class Your : My {
|
||||
class NestedThree : My.NestedOne
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
@Target(allowedTargets = NOT_CONST_EXPRESSION) annotation class base
|
||||
@base annotation class derived
|
||||
@base class correct {
|
||||
constructor(x: Int)
|
||||
@base constructor()
|
||||
@base val x: Int
|
||||
}
|
||||
@base enum class My {
|
||||
FIRST,
|
||||
SECOND,
|
||||
}
|
||||
@base fun foo(@base y: @base Int): Int {
|
||||
@base fun bar(@base z: @base Int): Int
|
||||
@base val local: Int
|
||||
}
|
||||
@base val z: Int
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
@Target(AnnotationTarget.ANNOTATION_CLASS) annotation class base
|
||||
|
||||
@base annotation class derived
|
||||
|
||||
@base class correct(@base val x: Int) {
|
||||
@base constructor(): this(0)
|
||||
}
|
||||
|
||||
@base enum class My {
|
||||
@base FIRST,
|
||||
@base SECOND
|
||||
}
|
||||
|
||||
@base fun foo(@base y: @base Int): Int {
|
||||
@base fun bar(@base z: @base Int) = z + 1
|
||||
@base val local = bar(y)
|
||||
return local
|
||||
}
|
||||
|
||||
@base val z = 0
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
@Target(allowedTargets = NOT_CONST_EXPRESSION) annotation class base
|
||||
@base annotation class derived
|
||||
@base class correct {
|
||||
constructor(@base x: Int)
|
||||
@base constructor()
|
||||
@base val x: Int
|
||||
}
|
||||
@base enum class My {
|
||||
FIRST,
|
||||
SECOND,
|
||||
}
|
||||
@base fun foo(@base y: @base Int): Int {
|
||||
@base fun bar(@base z: @base Int): Int
|
||||
@base val local: Int
|
||||
}
|
||||
@base val z: Int
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package a.b
|
||||
|
||||
class C<T, out S> {
|
||||
inner class D<R, in P> {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface Test {
|
||||
val x: a.b.C<out CharSequence, *>.D<in List<*>, *>
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class C<T, out S> {
|
||||
inner class D<R, in P>
|
||||
}
|
||||
interface Test {
|
||||
val x: C<out CharSequence, *>.D<in List<*>, *>
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
object A {
|
||||
constructor()
|
||||
init {}
|
||||
}
|
||||
|
||||
enum class B {
|
||||
X() {
|
||||
constructor()
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
constructor()
|
||||
}
|
||||
}
|
||||
|
||||
val anonObject = object {
|
||||
constructor()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
object A {
|
||||
constructor()
|
||||
}
|
||||
enum class B {
|
||||
X,
|
||||
}
|
||||
class C {
|
||||
companion object {
|
||||
constructor()
|
||||
}
|
||||
}
|
||||
val anonObject: Any
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
interface IFace<T> {
|
||||
fun getStatus(arg: T): Boolean
|
||||
}
|
||||
class Some
|
||||
|
||||
private fun resolve(): IFace<Some> {
|
||||
return object : IFace<Some> {
|
||||
override fun getStatus(arg: Some) = true
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
interface IFace<T> {
|
||||
fun getStatus(arg: T): Boolean
|
||||
}
|
||||
class Some
|
||||
private fun resolve(): IFace<Some> {
|
||||
object : IFace<Some> {
|
||||
constructor()
|
||||
override fun getStatus(arg: Some): Boolean
|
||||
}
|
||||
}
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
import kotlin.properties.ReadWriteProperty
|
||||
import kotlin.reflect.KCallable
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
public interface MyRwProperty<in T, V> {
|
||||
public operator fun setValue(thisRef: T, property: Any, value: V)
|
||||
public operator fun getValue(thisRef: T, property: Any): V
|
||||
}
|
||||
|
||||
val x: Int by lazy { 1 + 2 }
|
||||
|
||||
val delegate = object: MyRwProperty<Any?, Int> {
|
||||
override fun getValue(thisRef: Any?, property: Any): Int = 1
|
||||
override fun setValue(thisRef: Any?, property: Any, value: Int) {}
|
||||
}
|
||||
|
||||
val value by delegate
|
||||
|
||||
var variable by delegate
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
interface MyRwProperty<in T, V> {
|
||||
operator fun getValue(thisRef: T, property: Any): V
|
||||
operator fun setValue(thisRef: T, property: Any, value: V)
|
||||
}
|
||||
val x: Int
|
||||
get()
|
||||
val delegate: MyRwProperty<Any?, Int>
|
||||
val value: Int
|
||||
get()
|
||||
var variable: Int
|
||||
get()
|
||||
set(value: Int)
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
open class Base<T>(val x: T)
|
||||
|
||||
class Derived<T : Any>(x: T) : Base<T>(x)
|
||||
|
||||
fun <T : Any> create(x: T): Derived<T> = Derived(x)
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
open class Base<T> {
|
||||
constructor(x: T)
|
||||
val x: T
|
||||
}
|
||||
class Derived<T : Any> : Base<T> {
|
||||
constructor(x: T)
|
||||
}
|
||||
fun <T : Any> create(x: T): Derived<T>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
fun test() {
|
||||
val x = object {}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun test() {
|
||||
val x: Any
|
||||
}
|
||||
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
import my.println
|
||||
|
||||
enum class Order {
|
||||
FIRST,
|
||||
SECOND,
|
||||
THIRD
|
||||
}
|
||||
|
||||
enum class Planet(val m: Double, internal val r: Double) {
|
||||
MERCURY(1.0, 2.0) {
|
||||
override fun sayHello() {
|
||||
println("Hello!!!")
|
||||
}
|
||||
},
|
||||
VENERA(3.0, 4.0) {
|
||||
override fun sayHello() {
|
||||
println("Ola!!!")
|
||||
}
|
||||
},
|
||||
EARTH(5.0, 6.0) {
|
||||
override fun sayHello() {
|
||||
println("Privet!!!")
|
||||
}
|
||||
};
|
||||
|
||||
val g: Double = G * m / (r * r)
|
||||
|
||||
abstract fun sayHello()
|
||||
|
||||
companion object {
|
||||
const val G = 6.67e-11
|
||||
}
|
||||
}
|
||||
|
||||
enum class PseudoInsn(val signature: String = "()V") {
|
||||
FIX_STACK_BEFORE_JUMP,
|
||||
FAKE_ALWAYS_TRUE_IFEQ("()I"),
|
||||
FAKE_ALWAYS_FALSE_IFEQ("()I"),
|
||||
SAVE_STACK_BEFORE_TRY,
|
||||
RESTORE_STACK_IN_TRY_CATCH,
|
||||
STORE_NOT_NULL,
|
||||
AS_NOT_NULL("(Ljava/lang/Object;)Ljava/lang/Object;")
|
||||
;
|
||||
|
||||
fun emit() {}
|
||||
}
|
||||
analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/enums.rendered
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
enum class Order {
|
||||
FIRST,
|
||||
SECOND,
|
||||
THIRD,
|
||||
}
|
||||
enum class Planet {
|
||||
MERCURY,
|
||||
VENERA,
|
||||
EARTH,
|
||||
constructor(m: Double, r: Double)
|
||||
val g: Double
|
||||
val m: Double
|
||||
internal val r: Double
|
||||
abstract fun sayHello()
|
||||
companion object {
|
||||
const val G: Double
|
||||
}
|
||||
}
|
||||
enum class PseudoInsn {
|
||||
FIX_STACK_BEFORE_JUMP,
|
||||
FAKE_ALWAYS_TRUE_IFEQ,
|
||||
FAKE_ALWAYS_FALSE_IFEQ,
|
||||
SAVE_STACK_BEFORE_TRY,
|
||||
RESTORE_STACK_IN_TRY_CATCH,
|
||||
STORE_NOT_NULL,
|
||||
AS_NOT_NULL,
|
||||
constructor(signature: String = ...)
|
||||
val signature: String
|
||||
fun emit()
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
interface Some
|
||||
|
||||
object O1 : Some
|
||||
|
||||
object O2 : Some
|
||||
|
||||
enum class SomeEnum(val x: Some) {
|
||||
FIRST(O1) {
|
||||
override fun check(y: Some): Boolean = true
|
||||
},
|
||||
SECOND(O2) {
|
||||
override fun check(y: Some): Boolean = y == O2
|
||||
};
|
||||
|
||||
abstract fun check(y: Some): Boolean
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
interface Some
|
||||
object O1 : Some
|
||||
object O2 : Some
|
||||
enum class SomeEnum {
|
||||
FIRST,
|
||||
SECOND,
|
||||
constructor(x: Some)
|
||||
val x: Some
|
||||
abstract fun check(y: Some): Boolean
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
expect class MyClass
|
||||
|
||||
expect fun foo(): String
|
||||
|
||||
expect val x: Int
|
||||
|
||||
actual class MyClass
|
||||
|
||||
actual fun foo() = "Hello"
|
||||
|
||||
actual val x = 42
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
expect class MyClass
|
||||
expect fun foo(): String
|
||||
expect val x: Int
|
||||
actual class MyClass
|
||||
actual fun foo(): String
|
||||
actual val x: Int
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun <T> simpleRun(f: (T) -> Unit): Unit = f()
|
||||
|
||||
fun <T, R> List<T>.simpleMap(f: (T) -> R): R {
|
||||
|
||||
}
|
||||
|
||||
fun <T> simpleWith(t: T, f: T.() -> Unit): Unit = t.f()
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun <T> simpleRun(f: (T) -> Unit)
|
||||
fun <T, R> List<T>.simpleMap(f: (T) -> R): R
|
||||
fun <T> simpleWith(t: T, f: T.() -> Unit)
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
interface Any
|
||||
|
||||
inline fun <reified T : Any> Any.safeAs(): T? = this as? T
|
||||
|
||||
abstract class Summator {
|
||||
abstract fun <T> plus(first: T, second: T): T
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
interface Any
|
||||
inline fun <reified T : Any> Any.safeAs(): T?
|
||||
abstract class Summator {
|
||||
abstract fun <T> plus(first: T, second: T): T
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun <T> genericFoo(): T = TODO()
|
||||
|
||||
val <T> T.generic: T get() = genericFoo()
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun <T> genericFoo(): T
|
||||
val <T> T.generic: T
|
||||
get()
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
|
||||
private fun foo(x: Any) = if (x is String && x is Int) x else null
|
||||
+1
@@ -0,0 +1 @@
|
||||
private fun foo(x: Any): Any?
|
||||
analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/nestedClass.kt
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
abstract class Base(val s: String)
|
||||
|
||||
class Outer {
|
||||
class Derived(s: String) : Base(s)
|
||||
|
||||
object Obj : Base("")
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
abstract class Base {
|
||||
constructor(s: String)
|
||||
val s: String
|
||||
}
|
||||
class Outer {
|
||||
class Derived : Base {
|
||||
constructor(s: String)
|
||||
}
|
||||
object Obj : Base
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class NoPrimary {
|
||||
val x: String
|
||||
|
||||
constructor(x: String) {
|
||||
this.x = x
|
||||
}
|
||||
|
||||
constructor(): this("")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class NoPrimary {
|
||||
constructor()
|
||||
constructor(x: String)
|
||||
val x: String
|
||||
}
|
||||
analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/simpleClass.kt
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
interface SomeInterface {
|
||||
fun foo(x: Int, y: String): String
|
||||
val bar: Boolean
|
||||
}
|
||||
class SomeClass : SomeInterface {
|
||||
private val baz = 42
|
||||
override fun foo(x: Int, y: String): String {
|
||||
return y + x + baz
|
||||
}
|
||||
override var bar: Boolean
|
||||
get() = true
|
||||
set(value) {}
|
||||
lateinit var fau: Double
|
||||
}
|
||||
inline class InlineClass
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
interface SomeInterface {
|
||||
val bar: Boolean
|
||||
fun foo(x: Int, y: String): String
|
||||
}
|
||||
class SomeClass : SomeInterface {
|
||||
override var bar: Boolean
|
||||
get()
|
||||
set(value: Boolean)
|
||||
private val baz: Int
|
||||
lateinit var fau: Double
|
||||
override fun foo(x: Int, y: String): String
|
||||
}
|
||||
inline class InlineClass
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
fun foo() {}
|
||||
|
||||
suspend fun bar() {}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
fun foo()
|
||||
suspend fun bar()
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
interface B
|
||||
|
||||
typealias C = B
|
||||
|
||||
class D : C
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface B
|
||||
typealias C = B
|
||||
class D : C
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
open class A
|
||||
|
||||
interface B<S, T : A>
|
||||
|
||||
typealias C<T> = B<T, A>
|
||||
|
||||
class D : C<A>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
open class A
|
||||
interface B<S, T : A>
|
||||
typealias C<T> = B<T, A>
|
||||
class D : C<A>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test
|
||||
|
||||
interface Some
|
||||
|
||||
abstract class My<T : Some> {
|
||||
open inner class T
|
||||
|
||||
abstract val x: T
|
||||
|
||||
abstract fun foo(arg: T)
|
||||
|
||||
abstract val y: My<test.Some>.T
|
||||
|
||||
abstract val z: test.My<test.Some>.T
|
||||
|
||||
abstract class Some : My<test.Some>.T()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
interface Some
|
||||
abstract class My<T : Some> {
|
||||
abstract val x: T
|
||||
abstract val y: My<Some>.T
|
||||
abstract val z: My<Some>.T
|
||||
abstract fun foo(arg: T)
|
||||
abstract class Some : My<Some>.T
|
||||
open inner class T
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
interface List<out T : Any> {
|
||||
operator fun get(index: Int): T
|
||||
|
||||
infix fun concat(other: List<T>): List<T>
|
||||
}
|
||||
|
||||
typealias StringList = List<out String>
|
||||
typealias AnyList = List<*>
|
||||
|
||||
abstract class AbstractList<out T : Any> : List<T>
|
||||
|
||||
class SomeList : AbstractList<Int>() {
|
||||
override fun get(index: Int): Int = 42
|
||||
|
||||
override fun concat(other: List<Int>): List<Int> = this
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface List<out T : Any> {
|
||||
infix fun concat(other: List<T>): List<T>
|
||||
operator fun get(index: Int): T
|
||||
}
|
||||
typealias StringList = List<out String>
|
||||
typealias AnyList = List<*>
|
||||
abstract class AbstractList<out T : Any> : List<T>
|
||||
class SomeList : AbstractList<Int> {
|
||||
override infix fun concat(other: List<Int>): List<Int>
|
||||
override operator fun get(index: Int): Int
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
@Target(AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.TYPE) annotation class base
|
||||
|
||||
fun foo1(vararg ints: Int) {}
|
||||
fun foo2(@base vararg ints: @base Int) {}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
@Target(allowedTargets = NOT_CONST_EXPRESSION) annotation class base
|
||||
fun foo1(vararg ints: Int)
|
||||
fun foo2(@base vararg ints: @base Int)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
interface A
|
||||
interface B
|
||||
class C<T : A & B>
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
interface A
|
||||
interface B
|
||||
|
||||
class C<T> where T : A, T : B {
|
||||
|
||||
}
|
||||
analysis/analysis-api/testData/components/symbolDeclarationRenderer/renderDeclaration/where.rendered
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
interface A
|
||||
interface B
|
||||
class C<T : A> where T : B
|
||||
Reference in New Issue
Block a user