[IR] dumpKotlinLike: add testdata for FIR tests

This commit is contained in:
Zalim Bashorov
2020-11-20 18:18:14 +03:00
committed by teamcityserver
parent d7bd4240e1
commit c68040753d
298 changed files with 12186 additions and 0 deletions
@@ -0,0 +1,28 @@
annotation class A1 : Annotation {
constructor(x: Int) /* primary */
val x: Int
field = x
get
}
annotation class A2 : Annotation {
constructor(a: A1) /* primary */
val a: A1
field = a
get
}
annotation class AA : Annotation {
constructor(xs: Array<A1>) /* primary */
val xs: Array<A1>
field = xs
get
}
@A2(a = A1(x = 42))
@AA(xs = [A1(x = 1), A1(x = 2)])
fun test() {
}
@@ -0,0 +1,50 @@
annotation class Ann : Annotation {
constructor() /* primary */
}
interface IFoo {
@Ann
abstract val testVal: String
abstract get
@Ann
abstract fun testFun()
@Ann
abstract val String.testExtVal: String
abstract get
@Ann
abstract fun String.testExtFun()
}
class DFoo : IFoo {
constructor(d: IFoo) /* primary */ {
super/*Any*/()
/* <init>() */
<this>.#<$$delegate_0> = d
}
override fun testFun() {
<this>.#<$$delegate_0>.testFun()
}
override fun String.testExtFun() {
(<this>.#<$$delegate_0>, <this>).testExtFun()
}
override val testVal: String
override get(): String {
return <this>.#<$$delegate_0>.<get-testVal>()
}
override val String.testExtVal: String
override get(): String {
return (<this>.#<$$delegate_0>, <this>).<get-testExtVal>()
}
local /*final field*/ val <$$delegate_0>: IFoo
}
@@ -0,0 +1,31 @@
annotation class A : Annotation {
constructor(x: String = "", y: Int = 42) /* primary */
val x: String
field = x
get
val y: Int
field = y
get
}
@A(x = "abc", y = 123)
fun test1() {
}
@A(x = "def")
fun test2() {
}
@A(x = "ghi")
fun test3() {
}
@A(, y = 456)
fun test4() {
}
@A
fun test5() {
}
@@ -0,0 +1,19 @@
annotation class A : Annotation {
constructor(vararg xs: String) /* primary */
val xs: Array<out String>
field = xs
get
}
@A(xs = ["abc", "def"])
fun test1() {
}
@A(xs = ["abc"])
fun test2() {
}
@A(xs = [])
fun test3() {
}
@@ -0,0 +1,25 @@
annotation class TestAnnWithIntArray : Annotation {
constructor(x: IntArray) /* primary */
val x: IntArray
field = x
get
}
annotation class TestAnnWithStringArray : Annotation {
constructor(x: Array<String>) /* primary */
val x: Array<String>
field = x
get
}
@TestAnnWithIntArray(x = [1, 2, 3])
@TestAnnWithStringArray(x = ["a", "b", "c"])
fun test1() {
}
@TestAnnWithIntArray(x = [4, 5, 6])
@TestAnnWithStringArray(x = ["d", "e", "f"])
fun test2() {
}
@@ -0,0 +1,20 @@
annotation class A : Annotation {
constructor(klass: KClass<*>) /* primary */
val klass: KClass<*>
field = klass
get
}
class C {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
@A(klass = C::class)
fun test1() {
}
@@ -0,0 +1,71 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
@TestAnn(x = "class")
class TestClass {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
@TestAnn(x = "interface")
interface TestInterface {
}
@TestAnn(x = "object")
object TestObject {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Host {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
@TestAnn(x = "companion")
companion object TestCompanion {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
}
@TestAnn(x = "enum")
enum class TestEnum : Enum<TestEnum> {
private constructor() /* primary */ {
super/*Enum*/<TestEnum>()
/* <init>() */
}
fun values(): Array<TestEnum> /* Synthetic body for ENUM_VALUES */
fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */
}
@TestAnn(x = "annotation")
annotation class TestAnnotation : Annotation {
constructor() /* primary */
}
@@ -0,0 +1,19 @@
const val ONE: Int
field = 1
get
annotation class A : Annotation {
constructor(x: Int) /* primary */
val x: Int
field = x
get
}
@A(x = 1)
fun test1() {
}
@A(x = 2)
fun test2() {
}
@@ -0,0 +1,22 @@
annotation class TestAnn : Annotation {
constructor(x: Int) /* primary */
val x: Int
field = x
get
}
class TestClass {
@TestAnn(x = 1)
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
@TestAnn(x = 2)
constructor(x: Int) {
this/*TestClass*/()
}
}
@@ -0,0 +1,13 @@
annotation class Ann : Annotation {
constructor() /* primary */
}
val test1: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
get(): Int {
return #test1$delegate.getValue<Int>(thisRef = null, property = ::test1)
}
@@ -0,0 +1,47 @@
annotation class A : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
class Cell {
constructor(value: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
var value: Int
field = value
get
set
operator fun getValue(thisRef: Any?, kProp: Any?): Int {
return <this>.<get-value>()
}
operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int) {
<this>.<set-value>(<set-?> = newValue)
}
}
val test1: Int /* by */
field = Cell(value = 1)
@A(x = "test1.get")
get(): Int {
return #test1$delegate.getValue(thisRef = null, kProp = ::test1)
}
var test2: Int /* by */
field = Cell(value = 2)
@A(x = "test2.get")
get(): Int {
return #test2$delegate.getValue(thisRef = null, kProp = ::test2)
}
@A(x = "test2.set")
set(@A(x = "test2.set.param") <set-?>: Int) {
#test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = <set-?>)
}
@@ -0,0 +1,39 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
open enum class TestEnum : Enum<TestEnum> {
private constructor() /* primary */ {
super/*Enum*/<TestEnum>()
/* <init>() */
}
@TestAnn(x = "ENTRY1")
ENTRY1 = TestEnum()
@TestAnn(x = "ENTRY2")
ENTRY2 = ENTRY2()
@TestAnn(x = "ENTRY2")
private enum entry class ENTRY2 : TestEnum {
private constructor() /* primary */ {
super/*TestEnum*/()
/* <init>() */
}
val x: Int
field = 42
get
}
fun values(): Array<TestEnum> /* Synthetic body for ENUM_VALUES */
fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */
}
@@ -0,0 +1,32 @@
enum class En : Enum<En> {
private constructor() /* primary */ {
super/*Enum*/<En>()
/* <init>() */
}
A = En()
B = En()
C = En()
D = En()
fun values(): Array<En> /* Synthetic body for ENUM_VALUES */
fun valueOf(value: String): En /* Synthetic body for ENUM_VALUEOF */
}
annotation class TestAnn : Annotation {
constructor(x: En) /* primary */
val x: En
field = x
get
}
@TestAnn(x = En.A)
fun test1() {
}
@@ -0,0 +1,16 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
val testVal: String
field = "a val"
get
var testVar: String
field = "a var"
get
set
@@ -0,0 +1,11 @@
@file:A(x = "File annotation")
package test
@Target(allowedTargets = [AnnotationTarget.FILE])
annotation class A : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
@@ -0,0 +1,11 @@
annotation class TestAnn : Annotation {
constructor(x: Int) /* primary */
val x: Int
field = x
get
}
@TestAnn(x = 42)
fun testSimpleFunction() {
}
@@ -0,0 +1,64 @@
interface IFoo {
@Deprecated(message = "")
val prop: String
get(): String {
return ""
}
@Deprecated(message = "")
val String.extProp: String
get(): String {
return ""
}
}
class Delegated : IFoo {
constructor(foo: IFoo) /* primary */ {
super/*Any*/()
/* <init>() */
<this>.#<$$delegate_0> = foo
}
override val prop: String
override get(): String {
return <this>.#<$$delegate_0>.<get-prop>()
}
override val String.extProp: String
override get(): String {
return (<this>.#<$$delegate_0>, <this>).<get-extProp>()
}
local /*final field*/ val <$$delegate_0>: IFoo
}
class DefaultImpl : IFoo {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class ExplicitOverride : IFoo {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
override val prop: String
override get(): String {
return ""
}
override val String.extProp: String
override get(): String {
return ""
}
}
@@ -0,0 +1,19 @@
annotation class A : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
fun foo(m: Map<String, Int>) {
val test: Int
val test$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
local get(): Int {
return test$delegate.getValue<Int>(thisRef = null, property = ::test)
}
}
@@ -0,0 +1,20 @@
annotation class A1 : Annotation {
constructor() /* primary */
}
annotation class A2 : Annotation {
constructor() /* primary */
}
annotation class A3 : Annotation {
constructor() /* primary */
}
@A1
@A2
@A3
fun test() {
}
@@ -0,0 +1,17 @@
annotation class Ann : Annotation {
constructor() /* primary */
}
class Test {
constructor(@Ann x: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
get
}
@@ -0,0 +1,12 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
@TestAnn(x = "testVal.property")
val testVal: String
field = ""
get
@@ -0,0 +1,28 @@
annotation class A : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
class C {
constructor(x: Int, y: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
@A(x = "C.x.get")
get
var y: Int
field = y
@A(x = "C.y.get")
get
@A(x = "C.y.set")
set
}
@@ -0,0 +1,34 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
val test1: String
@TestAnn(x = "test1.get")
get(): String {
return ""
}
var test2: String
@TestAnn(x = "test2.get")
get(): String {
return ""
}
@TestAnn(x = "test2.set")
set(value: String) {
}
val test3: String
field = ""
@TestAnn(x = "test3.get")
get
var test4: String
field = ""
@TestAnn(x = "test4.get")
get
@TestAnn(x = "test4.set")
set
@@ -0,0 +1,23 @@
annotation class AnnParam : Annotation {
constructor() /* primary */
}
var p: Int
field = 0
get
set
class C {
constructor(p: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
var p: Int
field = p
get
set
}
@@ -0,0 +1,31 @@
annotation class Ann : Annotation {
constructor() /* primary */
}
class A {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun @Ann String.f(): String {
return ""
}
val @Ann String?.p: String
get(): String {
return ""
}
}
fun @Ann String?.topLevelF(): String {
return ""
}
val @Ann String.topLevelP: String
get(): String {
return ""
}
@@ -0,0 +1,11 @@
annotation class A : Annotation {
constructor(vararg xs: String) /* primary */
val xs: Array<out String>
field = xs
get
}
@A(xs = ["a", "b"])
fun test() {
}
@@ -0,0 +1,10 @@
@TestAnn(x = "TestTypeAlias")
typealias TestTypeAlias = String
@Target(allowedTargets = [AnnotationTarget.TYPEALIAS])
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
@@ -0,0 +1,8 @@
@Target(allowedTargets = [AnnotationTarget.TYPE_PARAMETER])
annotation class Anno : Annotation {
constructor() /* primary */
}
fun <T : Any?> foo() {
}
@@ -0,0 +1,23 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
fun testFun(@TestAnn(x = "testFun.x") x: Int) {
}
class TestClassConstructor1 {
constructor(@TestAnn(x = "TestClassConstructor1.x") x: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val xx: Int
field = x
get
}
@@ -0,0 +1,35 @@
annotation class A1 : Annotation {
constructor(vararg xs: Int) /* primary */
val xs: IntArray
field = xs
get
}
annotation class A2 : Annotation {
constructor(vararg xs: String) /* primary */
val xs: Array<out String>
field = xs
get
}
annotation class AA : Annotation {
constructor(vararg xs: A1) /* primary */
val xs: Array<out A1>
field = xs
get
}
@A1(xs = [1, 2, 3])
@A2(xs = ["a", "b", "c"])
@AA(xs = [A1(xs = [4]), A1(xs = [5]), A1(xs = [6])])
fun test1() {
}
@A1(xs = [])
@A2(xs = [])
@AA(xs = [])
fun test2() {
}
@@ -0,0 +1,12 @@
annotation class TestAnn : Annotation {
constructor(x: String) /* primary */
val x: String
field = x
get
}
fun foo() {
val testVal: String = "testVal"
var testVar: String = "testVar"
}
@@ -0,0 +1,7 @@
val test: Unit
field = try { // BLOCK
}
catch (e: Throwable){ // BLOCK
}
get
@@ -0,0 +1,56 @@
class C {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
val test1: Int
field = 0
get
val test2: Int
get(): Int {
return 0
}
var test3: Int
field = 0
get
set
var test4: Int
field = 1
get
set(value: Int) {
<this>.#test4 = value
}
var test5: Int
field = 1
get
private set
val test6: Int
field = 1
get
val test7: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
get(): Int {
return <this>.#test7$delegate.getValue<Int>(thisRef = <this>, property = C::test7)
}
var test8: Int? /* by */
field = hashMapOf<String, Int>()
get(): Int? {
return <this>.#test8$delegate.getValue<Int?, Int?>(thisRef = <this>, property = C::test8)
}
set(<set-?>: Int?) {
<this>.#test8$delegate.setValue<Int?>(thisRef = <this>, property = C::test8, value = <set-?>)
}
}
@@ -0,0 +1,48 @@
val test1: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
get(): Int {
return #test1$delegate.getValue<Int>(thisRef = null, property = ::test1)
}
class C {
constructor(map: MutableMap<String, Any>) /* primary */ {
super/*Any*/()
/* <init>() */
}
val map: MutableMap<String, Any>
field = map
get
val test2: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
get(): Int {
return <this>.#test2$delegate.getValue<Int>(thisRef = <this>, property = C::test2)
}
var test3: Any /* by */
field = <this>.<get-map>()
get(): Any {
return <this>.#test3$delegate.getValue<Any, Any>(thisRef = <this>, property = C::test3)
}
set(<set-?>: Any) {
<this>.#test3$delegate.setValue<Any>(thisRef = <this>, property = C::test3, value = <set-?>)
}
}
var test4: Any? /* by */
field = hashMapOf<String, Any>()
get(): Any? {
return #test4$delegate.getValue<Any?, Any?>(thisRef = null, property = ::test4)
}
set(<set-?>: Any?) {
#test4$delegate.setValue<Any?>(thisRef = null, property = ::test4, value = <set-?>)
}
@@ -0,0 +1,35 @@
interface IFooStr {
abstract fun foo(x: String)
}
interface IBar {
abstract val bar: Int
abstract get
}
abstract class CFoo<T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun foo(x: T) {
}
}
class Test1 : CFoo<String>, IFooStr, IBar {
constructor() /* primary */ {
super/*CFoo*/<String>()
/* <init>() */
}
override val bar: Int
field = 42
override get
}
@@ -0,0 +1,33 @@
class C<T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
object Delegate {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
operator fun getValue(thisRef: Any?, kProp: Any?): Int {
return 42
}
operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int) {
}
}
var <T : Any?> C<T>.genericDelegatedProperty: Int /* by */
field = Delegate
get(): Int {
return #genericDelegatedProperty$delegate.getValue(thisRef = <this>, kProp = ::genericDelegatedProperty/*</* null */>()*/)
}
set(<set-?>: Int) {
#genericDelegatedProperty$delegate.setValue(thisRef = <this>, kProp = ::genericDelegatedProperty/*</* null */>()*/, newValue = <set-?>)
}
@@ -0,0 +1,108 @@
inline class IT {
constructor(x: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
get
override fun equals(other: Any?): Boolean {
when {
other !is IT -> return false
}
val tmp0_other_with_cast: IT = other as IT
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
}
return true
}
override fun hashCode(): Int {
return <this>.#x.hashCode()
}
override fun toString(): String {
return "IT(" + "x=" + <this>.#x + ")"
}
}
inline class InlineMutableSet : MutableSet<IT> {
constructor(ms: MutableSet<IT>) /* primary */ {
super/*Any*/()
/* <init>() */
}
private val ms: MutableSet<IT>
field = ms
private get
override val size: Int
override get(): Int {
return <this>.<get-ms>().<get-size>()
}
override operator fun contains(element: IT): Boolean {
return <this>.<get-ms>().contains(element = element)
}
override fun containsAll(elements: Collection<IT>): Boolean {
return <this>.<get-ms>().containsAll(elements = elements)
}
override fun isEmpty(): Boolean {
return <this>.<get-ms>().isEmpty()
}
override fun add(element: IT): Boolean {
return <this>.<get-ms>().add(element = element)
}
override fun addAll(elements: Collection<IT>): Boolean {
return <this>.<get-ms>().addAll(elements = elements)
}
override fun clear() {
<this>.<get-ms>().clear()
}
override operator fun iterator(): MutableIterator<IT> {
return <this>.<get-ms>().iterator()
}
override fun remove(element: IT): Boolean {
return <this>.<get-ms>().remove(element = element)
}
override fun removeAll(elements: Collection<IT>): Boolean {
return <this>.<get-ms>().removeAll(elements = elements)
}
override fun retainAll(elements: Collection<IT>): Boolean {
return <this>.<get-ms>().retainAll(elements = elements)
}
override fun equals(other: Any?): Boolean {
when {
other !is InlineMutableSet -> return false
}
val tmp0_other_with_cast: InlineMutableSet = other as InlineMutableSet
when {
EQEQ(arg0 = <this>.#ms, arg1 = tmp0_other_with_cast.#ms).not() -> return false
}
return true
}
override fun hashCode(): Int {
return <this>.#ms.hashCode()
}
override fun toString(): String {
return "InlineMutableSet(" + "ms=" + <this>.#ms + ")"
}
}
@@ -0,0 +1,18 @@
package interop
object Definitions {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
const val KT_CONSTANT: String?
field = "constant"
get
val ktValue: String?
field = #CONSTANT
get
}
@@ -0,0 +1,24 @@
interface I {
val <T : Any?> T.id: T
get(): T {
return <this>
}
}
class A : I {
constructor(i: I) /* primary */ {
super/*Any*/()
/* <init>() */
<this>.#<$$delegate_0> = i
}
override val <T : Any?> T.id: T
override get(): T {
return (<this>.#<$$delegate_0>, <this>).<get-id></* null */>()
}
local /*final field*/ val <$$delegate_0>: I
}
@@ -0,0 +1,40 @@
fun outer() {
local abstract class ALocal {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
abstract fun afun()
abstract val aval: Int
abstract get
abstract var avar: Int
abstract get
abstract set
}
local class Local : ALocal {
constructor() /* primary */ {
super/*ALocal*/()
/* <init>() */
}
override fun afun() {
}
override val aval: Int
field = 1
override get
override var avar: Int
field = 2
override get
override set
}
}
@@ -0,0 +1,29 @@
fun test1() {
val x: Int
val x$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
local get(): Int {
return x$delegate.getValue<Int>(thisRef = null, property = ::x)
}
println(message = <get-x>())
}
fun test2() {
var x: Int?
val x$delegate: HashMap<String, Int> = hashMapOf<String, Int>()
local get(): Int? {
return x$delegate.getValue<Int?, Int?>(thisRef = null, property = ::x)
}
local set(<set-?>: Int?) {
x$delegate.setValue<Int?>(thisRef = null, property = ::x, value = <set-?>)
}
<set-x>(<set-?> = 0)
val <unary>: Int = <get-x>() /*as Int */
<set-x>(<set-?> = <unary>.inc())
<unary> /*~> Unit */
<set-x>(<set-?> = <get-x>() /*as Int */.plus(other = 1))
}
@@ -0,0 +1,5 @@
fun foo() {
do// COMPOSITE {
val x: Int = 42
// } while (EQEQ(arg0 = x, arg1 = 42).not())
}
@@ -0,0 +1,38 @@
expect abstract class A {
protected expect constructor() /* primary */
expect abstract fun foo()
}
expect open class B : A {
expect constructor(i: Int) /* primary */
expect override fun foo()
expect open fun bar(s: String)
}
abstract class A {
protected constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
abstract fun foo()
}
open class B : A {
constructor(i: Int) /* primary */ {
super/*A*/()
/* <init>() */
}
override fun foo() {
}
open fun bar(s: String) {
}
}
@@ -0,0 +1,29 @@
expect enum class MyEnum : Enum<MyEnum> {
private expect constructor() /* primary */
FOO = MyEnum()
BAR = MyEnum()
expect fun values(): Array<MyEnum>
expect fun valueOf(value: String): MyEnum
}
enum class MyEnum : Enum<MyEnum> {
private constructor() /* primary */ {
super/*Enum*/<MyEnum>()
/* <init>() */
}
FOO = MyEnum()
BAR = MyEnum()
BAZ = MyEnum()
fun values(): Array<MyEnum> /* Synthetic body for ENUM_VALUES */
fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */
}
@@ -0,0 +1,27 @@
expect sealed class Ops {
private expect constructor() /* primary */
}
expect class Add : Ops {
expect constructor() /* primary */
}
sealed class Ops {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Add : Ops {
constructor() /* primary */ {
super/*Ops*/()
/* <init>() */
}
}
@@ -0,0 +1,47 @@
val test1: Int
field = 0
get
val test2: Int
get(): Int {
return 0
}
var test3: Int
field = 0
get
set
var test4: Int
field = 1
get
set(value: Int) {
#test4 = value
}
var test5: Int
field = 1
get
private set
val test6: Int
field = 1
get
val test7: Int /* by */
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
return 42
}
)
get(): Int {
return #test7$delegate.getValue<Int>(thisRef = null, property = ::test7)
}
var test8: Int? /* by */
field = hashMapOf<String, Int>()
get(): Int? {
return #test8$delegate.getValue<Int?, Int?>(thisRef = null, property = ::test8)
}
set(<set-?>: Int?) {
#test8$delegate.setValue<Int?>(thisRef = null, property = ::test8, value = <set-?>)
}
@@ -0,0 +1,80 @@
class Test1<T1 : Any?, T2 : Any?> {
constructor(x: T1, y: T2) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: T1
field = x
get
val y: T2
field = y
get
}
class Test2 {
constructor(x: Int, y: String) /* primary */ {
super/*Any*/()
/* <init>() */
}
val y: String
field = y
get
inner class TestInner<Z : Any?> {
constructor(z: Z) /* primary */ {
super/*Any*/()
/* <init>() */
}
val z: Z
field = z
get
constructor(z: Z, i: Int) {
<this>.this/*TestInner*/<Z>(z = z)
}
}
}
class Test3 {
constructor(x: Int, y: String = "") /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
get
val y: String
field = y
get
}
class Test4<T : Any?> {
constructor(x: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: Int
field = x
get
constructor(x: Int, y: Int = 42) {
this/*Test4*/<T>(x = x.plus(other = y))
}
}
@@ -0,0 +1,58 @@
data class Test<T : Any?> {
constructor(x: T, y: String = "") /* primary */ {
super/*Any*/()
/* <init>() */
}
val x: T
field = x
get
val y: String
field = y
get
fun component1(): T {
return <this>.#x
}
fun component2(): String {
return <this>.#y
}
fun copy(x: T = <this>.#x, y: String = <this>.#y): Test<T> {
return Test<Any>(x = x, y = y)
}
override fun equals(other: Any?): Boolean {
when {
EQEQEQ(arg0 = <this>, arg1 = other) -> return true
}
when {
other !is Test<T> -> return false
}
val tmp0_other_with_cast: Test<T> = other as Test<T>
when {
EQEQ(arg0 = <this>.#x, arg1 = tmp0_other_with_cast.#x).not() -> return false
}
when {
EQEQ(arg0 = <this>.#y, arg1 = tmp0_other_with_cast.#y).not() -> return false
}
return true
}
override fun hashCode(): Int {
var result: Int = when {
EQEQ(arg0 = <this>.#x, arg1 = null) -> 0
else -> <this>.#x.hashCode()
}
result = result.times(other = 31).plus(other = <this>.#y.hashCode())
return result
}
override fun toString(): String {
return "Test(" + "x=" + <this>.#x + ", " + "y=" + <this>.#y + ")"
}
}
@@ -0,0 +1,33 @@
interface IBase<T : Any?> {
abstract fun foo(x: Int)
abstract val bar: Int
abstract get
abstract fun <X : Any?> qux(t: T, x: X)
}
class Test<TT : Any?> : IBase<TT> {
constructor(impl: IBase<TT>) /* primary */ {
super/*Any*/()
/* <init>() */
<this>.#<$$delegate_0> = impl
}
override fun foo(x: Int) {
<this>.#<$$delegate_0>.foo(x = x)
}
override fun <X : Any?> qux(t: TT, x: X) {
<this>.#<$$delegate_0>.qux</* null */>(t = t, x = x)
}
override val bar: Int
override get(): Int {
return <this>.#<$$delegate_0>.<get-bar>()
}
local /*final field*/ val <$$delegate_0>: IBase<TT>
}
@@ -0,0 +1,26 @@
val test1: Function1<String, String>
field = local fun <anonymous>(it: String): String {
return it
}
get
val test2: @ExtensionFunctionType @ExtensionFunctionType Function2<Any, Any, Any>
field = local fun Any.<anonymous>(it: Any): Int {
return it.hashCode()
}
get
val test3: Function2<Int, Int, Unit>
field = local fun <anonymous>(i: Int, j: Int) {
return Unit
}
get
val test4: Function2<Int, Int, Unit>
field = local fun <no name provided>(i: Int, j: Int) {
}
get
@@ -0,0 +1,17 @@
class Test1<T : U, U : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
fun <T : U, U : Any?> test2() {
}
var <T : U, U : Any?> Test1<T, U>.test3: Unit
get() {
}
set(value: Unit) {
}
@@ -0,0 +1,38 @@
abstract class Base1<T : Derived1> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Derived1 : Base1<Derived1> {
constructor() /* primary */ {
super/*Base1*/<Derived1>()
/* <init>() */
}
}
abstract class Base2 {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun <T : Derived2> foo(x: T) {
}
}
class Derived2 : Base2 {
constructor() /* primary */ {
super/*Base2*/()
/* <init>() */
}
}
@@ -0,0 +1,25 @@
fun f(f1: Function0<String> = local fun <anonymous>(): ErrorType /* ERROR */ {
return error("") /* ERROR CALL */
}
, f2: Function0<String> = local fun <anonymous>(): String {
return "FAIL"
}
): String {
return f1.invoke()
}
fun box(): String {
var result: String = "fail"
try f()
catch (e: Exception){ // BLOCK
result = "OK"
}
/*~> Unit */
return f(, f2 = local fun <anonymous>(): String {
return "O"
}
).plus(other = f(f1 = local fun <anonymous>(): String {
return "K"
}
))
}
@@ -0,0 +1,39 @@
object Host {
private constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
class StringDelegate {
constructor(s: String) /* primary */ {
super/*Any*/()
/* <init>() */
}
val s: String
field = s
get
operator fun getValue(receiver: String, p: Any): String {
return receiver.plus(other = <this>.<get-s>())
}
}
operator fun String.provideDelegate(host: Any?, p: Any): StringDelegate {
return StringDelegate(s = <this>)
}
val String.plusK: String /* by */
field = (<this>, "K").provideDelegate(host = <this>, p = Host::plusK)
get(): String {
return <this>.#plusK$delegate.getValue(receiver = <this>, p = Host::plusK)
}
val ok: String
field = (<this>, "O").<get-plusK>()
get
}
@@ -0,0 +1,14 @@
typealias Test1 = String
fun foo() {
{ // BLOCK
}
}
class C {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
}