[FIR-TEST] Move analysis tests to separate module

This commit is contained in:
Dmitriy Novozhilov
2020-03-18 15:10:46 +03:00
parent 3a479d5d16
commit cc07ae96b3
1477 changed files with 1001 additions and 980 deletions
@@ -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<*>, *>
}
@@ -0,0 +1,19 @@
FILE: complexTypes.kt
public final class C<T, out S> : R|kotlin/Any| {
public constructor<T, out S>(): R|a/b/C<T, S>| {
super<R|kotlin/Any|>()
}
public final inner class D<R, in P> : R|kotlin/Any| {
public constructor<R, in P>(): R|a/b/C.D<R, P>| {
super<R|kotlin/Any|>()
}
}
}
public abstract interface Test : R|kotlin/Any| {
public abstract val x: R|a/b/C.D<out kotlin/CharSequence, *, in kotlin/collections/List<*>, *>|
public get(): R|a/b/C.D<out kotlin/CharSequence, *, in kotlin/collections/List<*>, *>|
}
@@ -0,0 +1,33 @@
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() {
<!UNRESOLVED_REFERENCE!>println<!>("Hello!!!")
}
},
VENERA(3.0, 4.0) {
override fun sayHello() {
<!UNRESOLVED_REFERENCE!>println<!>("Ola!!!")
}
},
EARTH(5.0, 6.0) {
override fun sayHello() {
<!UNRESOLVED_REFERENCE!>println<!>("Privet!!!")
}
};
val g: Double = G * m / (r * r)
abstract fun sayHello()
companion object {
const val G = 6.67e-11
}
}
@@ -0,0 +1,82 @@
FILE: enums.kt
public final enum class Order : R|kotlin/Enum<Order>| {
private constructor(): R|Order| {
super<R|kotlin/Enum<Order>|>()
}
public final static enum entry FIRST: R|Order|
public final static enum entry SECOND: R|Order|
public final static enum entry THIRD: R|Order|
public final static fun values(): R|kotlin/Array<Order>| {
}
public final static fun valueOf(value: R|kotlin/String|): R|Order| {
}
}
public final enum class Planet : R|kotlin/Enum<Planet>| {
private constructor(m: R|kotlin/Double|, r: R|kotlin/Double|): R|Planet| {
super<R|kotlin/Enum<Planet>|>()
}
public final val m: R|kotlin/Double| = R|<local>/m|
public get(): R|kotlin/Double|
internal final val r: R|kotlin/Double| = R|<local>/r|
internal get(): R|kotlin/Double|
public final static enum entry MERCURY: R|Planet| = object : R|Planet| {
private constructor(): R|anonymous| {
super<R|Planet|>(Double(1.0), Double(2.0))
}
public final override fun sayHello(): R|kotlin/Unit| {
<Unresolved name: println>#(String(Hello!!!))
}
}
public final static enum entry VENERA: R|Planet| = object : R|Planet| {
private constructor(): R|anonymous| {
super<R|Planet|>(Double(3.0), Double(4.0))
}
public final override fun sayHello(): R|kotlin/Unit| {
<Unresolved name: println>#(String(Ola!!!))
}
}
public final static enum entry EARTH: R|Planet| = object : R|Planet| {
private constructor(): R|anonymous| {
super<R|Planet|>(Double(5.0), Double(6.0))
}
public final override fun sayHello(): R|kotlin/Unit| {
<Unresolved name: println>#(String(Privet!!!))
}
}
public final val g: R|kotlin/Double| = this@R|/Planet.Companion|.R|/Planet.Companion.G|.R|kotlin/Double.times|(R|<local>/m|).R|kotlin/Double.div|(R|<local>/r|.R|kotlin/Double.times|(R|<local>/r|))
public get(): R|kotlin/Double|
public abstract fun sayHello(): R|kotlin/Unit|
public final companion object Companion : R|kotlin/Any| {
private constructor(): R|Planet.Companion| {
super<R|kotlin/Any|>()
}
public final const val G: R|kotlin/Double| = Double(6.67E-11)
public get(): R|kotlin/Double|
}
public final static fun values(): R|kotlin/Array<Planet>| {
}
public final static fun valueOf(value: R|kotlin/String|): R|Planet| {
}
}
@@ -0,0 +1,9 @@
class NoPrimary {
val x: String
constructor(x: String) {
this.x = x
}
constructor(): this("")
}
@@ -0,0 +1,15 @@
FILE: noPrimaryConstructor.kt
public final class NoPrimary : R|kotlin/Any| {
public final val x: R|kotlin/String|
public get(): R|kotlin/String|
public constructor(x: R|kotlin/String|): R|NoPrimary| {
super<R|kotlin/Any|>()
this@R|/NoPrimary|.R|/NoPrimary.x| = R|<local>/x|
}
public constructor(): R|NoPrimary| {
this<R|NoPrimary|>(String())
}
}
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,38 @@
FILE: simpleClass.kt
public abstract interface SomeInterface : R|kotlin/Any| {
public abstract fun foo(x: R|kotlin/Int|, y: R|kotlin/String|): R|kotlin/String|
public abstract val bar: R|kotlin/Boolean|
public get(): R|kotlin/Boolean|
}
public final class SomeClass : R|SomeInterface| {
public constructor(): R|SomeClass| {
super<R|kotlin/Any|>()
}
private final val baz: R|kotlin/Int| = Int(42)
private get(): R|kotlin/Int|
public final override fun foo(x: R|kotlin/Int|, y: R|kotlin/String|): R|kotlin/String| {
^foo R|<local>/y|.R|kotlin/String.plus|(R|<local>/x|).R|kotlin/String.plus|(this@R|/SomeClass|.R|/SomeClass.baz|)
}
public final override var bar: R|kotlin/Boolean|
public get(): R|kotlin/Boolean| {
^ Boolean(true)
}
public set(value: R|kotlin/Boolean|): R|kotlin/Unit| {
}
public final lateinit var fau: R|kotlin/Double|
public get(): R|kotlin/Double|
public set(value: R|kotlin/Double|): R|kotlin/Unit|
}
public final inline class InlineClass : R|kotlin/Any| {
public constructor(): R|InlineClass| {
super<R|kotlin/Any|>()
}
}
@@ -0,0 +1,16 @@
interface List<out T : Any> {
operator fun get(index: Int): T
<!INAPPLICABLE_INFIX_MODIFIER!>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
}
@@ -0,0 +1,29 @@
FILE: typeParameters.kt
public abstract interface List<out T : R|kotlin/Any|> : R|kotlin/Any| {
public abstract operator fun get(index: R|kotlin/Int|): R|T|
public abstract infix fun concat(other: R|List<T>|): R|List<T>|
}
public final typealias StringList = R|List<out kotlin/String>|
public final typealias AnyList = R|List<*>|
public abstract class AbstractList<out T : R|kotlin/Any|> : R|List<T>| {
public constructor<out T : R|kotlin/Any|>(): R|AbstractList<T>| {
super<R|kotlin/Any|>()
}
}
public final class SomeList : R|AbstractList<kotlin/Int>| {
public constructor(): R|SomeList| {
super<R|AbstractList<kotlin/Int>|>()
}
public final override fun get(index: R|kotlin/Int|): R|kotlin/Int| {
^get Int(42)
}
public final override fun concat(other: R|List<kotlin/Int>|): R|List<kotlin/Int>| {
^concat this@R|/SomeList|
}
}