[IR] add testdata for dumpKotlinLike
This commit is contained in:
committed by
teamcityserver
parent
d2022ab115
commit
8d5facb15f
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
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(...)
|
||||
@AA(...)
|
||||
fun test() {
|
||||
}
|
||||
|
||||
Vendored
+35
@@ -0,0 +1,35 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(x: String = "", y: Int = 42) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
val y: Int
|
||||
field = y
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test2() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test3() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test4() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test5() {
|
||||
}
|
||||
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(vararg xs: String) /* primary */
|
||||
val xs: Array<out String>
|
||||
field = xs
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test2() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test3() {
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
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(...)
|
||||
@TestAnnWithStringArray(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
@TestAnnWithIntArray(...)
|
||||
@TestAnnWithStringArray(...)
|
||||
fun test2() {
|
||||
}
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(klass: KClass<*>) /* primary */
|
||||
val klass: KClass<*>
|
||||
field = klass
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
class TestClass {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
interface TestInterface {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
object TestObject {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Host {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
companion object TestCompanion {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
enum class TestEnum : Enum<TestEnum> {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrEnumConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fun values(): Array<TestEnum> /* Synthetic body for ENUM_VALUES */
|
||||
|
||||
fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
annotation class TestAnnotation : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
const val ONE: Int
|
||||
field = 1
|
||||
get
|
||||
|
||||
annotation class A : Annotation {
|
||||
constructor(x: Int) /* primary */
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test2() {
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: Int) /* primary */
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class TestClass {
|
||||
@TestAnn(...)
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
constructor(x: Int) {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
annotation class Ann : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
val test1: Int /* by */
|
||||
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
|
||||
return 42
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test1$delegate, thisRef = null, property = ::test1)
|
||||
}
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Cell {
|
||||
constructor(value: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
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 = TODO("IrConstructorCall")
|
||||
@A(...)
|
||||
get(): Int {
|
||||
return #test1$delegate.getValue(thisRef = null, kProp = ::test1)
|
||||
}
|
||||
|
||||
var test2: Int /* by */
|
||||
field = TODO("IrConstructorCall")
|
||||
@A(...)
|
||||
get(): Int {
|
||||
return #test2$delegate.getValue(thisRef = null, kProp = ::test2)
|
||||
}
|
||||
@A(...)
|
||||
set(<set-?>: Int) {
|
||||
return #test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = <set-?>)
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
open enum class TestEnum : Enum<TestEnum> {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrEnumConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
ENTRY1 init = TODO("IrEnumConstructorCall") @TestAnn(...)
|
||||
ENTRY2 init = TODO("IrEnumConstructorCall")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fun values(): Array<TestEnum> /* Synthetic body for ENUM_VALUES */
|
||||
|
||||
fun valueOf(value: String): TestEnum /* Synthetic body for ENUM_VALUEOF */
|
||||
|
||||
}
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
enum class En : Enum<En> {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrEnumConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
A init = TODO("IrEnumConstructorCall") B init = TODO("IrEnumConstructorCall") C init = TODO("IrEnumConstructorCall") D init = TODO("IrEnumConstructorCall")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
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,15 @@
|
||||
@file:A(...)
|
||||
package test
|
||||
|
||||
@Target(...)
|
||||
annotation class A : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: Int) /* primary */
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
fun testSimpleFunction() {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
@JavaAnn(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
@JavaAnn(...)
|
||||
fun test2() {
|
||||
}
|
||||
|
||||
@JavaAnn(...)
|
||||
fun test3() {
|
||||
}
|
||||
|
||||
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun foo(m: Map<String, Int>) {
|
||||
@A(...)
|
||||
val test: Int
|
||||
val test$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
|
||||
return 42
|
||||
}
|
||||
)
|
||||
local get(): Int {
|
||||
return getValue<Int>($receiver = test$delegate, thisRef = null, property = ::test)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
annotation class A1 : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
annotation class A2 : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
annotation class A3 : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@A1
|
||||
@A2
|
||||
@A3
|
||||
fun test() {
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
annotation class Ann : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Test {
|
||||
constructor(x: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
val testVal: String
|
||||
field = ""
|
||||
get
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor(x: Int, y: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: Int
|
||||
field = x
|
||||
@A(...)
|
||||
get
|
||||
|
||||
var y: Int
|
||||
field = y
|
||||
@A(...)
|
||||
get
|
||||
@A(...)
|
||||
set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
val test1: String
|
||||
@TestAnn(...)
|
||||
get(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
var test2: String
|
||||
@TestAnn(...)
|
||||
get(): String {
|
||||
return ""
|
||||
}
|
||||
@TestAnn(...)
|
||||
set(value: String) {
|
||||
}
|
||||
|
||||
val test3: String
|
||||
field = ""
|
||||
@TestAnn(...)
|
||||
get
|
||||
|
||||
var test4: String
|
||||
field = ""
|
||||
@TestAnn(...)
|
||||
get
|
||||
@TestAnn(...)
|
||||
set
|
||||
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
annotation class AnnParam : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
var p: Int
|
||||
field = 0
|
||||
get
|
||||
set
|
||||
|
||||
class C {
|
||||
constructor(p: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
var p: Int
|
||||
field = p
|
||||
get
|
||||
set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
annotation class Ann : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class A {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
fun String.f(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
val String?.p: String
|
||||
get(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun String?.topLevelF(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
val String.topLevelP: String
|
||||
get(): String {
|
||||
return ""
|
||||
}
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
annotation class A : Annotation {
|
||||
constructor(vararg xs: String) /* primary */
|
||||
val xs: Array<out String>
|
||||
field = xs
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@A(...)
|
||||
fun test() {
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
@Target(...)
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@TestAnn(...)
|
||||
typealias TestTypeAlias = String
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
@Target(...)
|
||||
annotation class Anno : Annotation {
|
||||
constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun <@Anno T : Any?> foo() {
|
||||
}
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun testFun(x: Int) {
|
||||
}
|
||||
|
||||
class TestClassConstructor1 {
|
||||
constructor(x: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val xx: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
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(...)
|
||||
@A2(...)
|
||||
@AA(...)
|
||||
fun test1() {
|
||||
}
|
||||
|
||||
@A1(...)
|
||||
@A2(...)
|
||||
@AA(...)
|
||||
fun test2() {
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
annotation class TestAnn : Annotation {
|
||||
constructor(x: String) /* primary */
|
||||
val x: String
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
@TestAnn(...)
|
||||
val testVal: String = "testVal"
|
||||
@TestAnn(...)
|
||||
var testVar: String = "testVar"
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
val test: Unit
|
||||
field = try { //BLOCK
|
||||
}
|
||||
catch (...) { //BLOCK
|
||||
}
|
||||
|
||||
get
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
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 getValue<Int>($receiver = #test7$delegate, thisRef = <this>, property = ::test7)
|
||||
}
|
||||
|
||||
var test8: Int /* by */
|
||||
field = hashMapOf<String, Int>()
|
||||
get(): Int {
|
||||
return getValue<Int, Int>($receiver = #test8$delegate, thisRef = <this>, property = ::test8)
|
||||
}
|
||||
set(<set-?>: Int) {
|
||||
return setValue<Int>($receiver = #test8$delegate, thisRef = <this>, property = ::test8, value = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
const val I0: Int
|
||||
field = 0
|
||||
get
|
||||
|
||||
const val I1: Int
|
||||
field = 1
|
||||
get
|
||||
|
||||
const val I2: Int
|
||||
field = 2
|
||||
get
|
||||
|
||||
const val STR1: String
|
||||
field = "String1"
|
||||
get
|
||||
|
||||
const val STR2: String
|
||||
field = "String2"
|
||||
get
|
||||
|
||||
const val STR3: String
|
||||
field = "String1String2"
|
||||
get
|
||||
|
||||
const val STR4: String
|
||||
field = "String1String2"
|
||||
get
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
fun test1(x: Int, y: Int = 0, z: String = "abc") {
|
||||
local fun local(xx: Int = x, yy: Int = y, zz: String = z) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
val test1: Int /* by */
|
||||
field = lazy<Int>(initializer = local fun <anonymous>(): Int {
|
||||
return 42
|
||||
}
|
||||
)
|
||||
get(): Int {
|
||||
return getValue<Int>($receiver = #test1$delegate, thisRef = null, property = ::test1)
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor(map: MutableMap<String, Any>) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
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 getValue<Int>($receiver = #test2$delegate, thisRef = <this>, property = ::test2)
|
||||
}
|
||||
|
||||
var test3: Any /* by */
|
||||
field = <this>.<get-map>()
|
||||
get(): Any {
|
||||
return getValue<Any, Any>($receiver = #test3$delegate, thisRef = <this>, property = ::test3)
|
||||
}
|
||||
set(<set-?>: Any) {
|
||||
return setValue<Any>($receiver = #test3$delegate, thisRef = <this>, property = ::test3, value = <set-?>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
var test4: Any /* by */
|
||||
field = hashMapOf<String, Any>()
|
||||
get(): Any {
|
||||
return getValue<Any, Any>($receiver = #test4$delegate, thisRef = null, property = ::test4)
|
||||
}
|
||||
set(<set-?>: Any) {
|
||||
return setValue<Any>($receiver = #test4$delegate, thisRef = null, property = ::test4, value = <set-?>)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
@Deprecated(...)
|
||||
val testVal: Int
|
||||
field = 1
|
||||
get
|
||||
|
||||
@Deprecated(...)
|
||||
var testVar: Int
|
||||
field = 1
|
||||
get
|
||||
set
|
||||
|
||||
@Deprecated(...)
|
||||
val testValWithExplicitDefaultGet: Int
|
||||
field = 1
|
||||
get
|
||||
|
||||
@Deprecated(...)
|
||||
val testValWithExplicitGet: Int
|
||||
get(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
@Deprecated(...)
|
||||
var testVarWithExplicitDefaultGet: Int
|
||||
field = 1
|
||||
get
|
||||
set
|
||||
|
||||
@Deprecated(...)
|
||||
var testVarWithExplicitDefaultSet: Int
|
||||
field = 1
|
||||
get
|
||||
set
|
||||
|
||||
@Deprecated(...)
|
||||
var testVarWithExplicitDefaultGetSet: Int
|
||||
field = 1
|
||||
get
|
||||
set
|
||||
|
||||
@Deprecated(...)
|
||||
var testVarWithExplicitGetSet: Int
|
||||
get(): Int {
|
||||
return 1
|
||||
}
|
||||
set(v: Int) {
|
||||
}
|
||||
|
||||
@Deprecated(...)
|
||||
lateinit var testLateinitVar: Any
|
||||
get
|
||||
set
|
||||
|
||||
@Deprecated(...)
|
||||
val Any.testExtVal: Int
|
||||
get(): Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
@Deprecated(...)
|
||||
var Any.textExtVar: Int
|
||||
get(): Int {
|
||||
return 1
|
||||
}
|
||||
set(v: Int) {
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
val String.test1: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var String.test2: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
class Host {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val String.test3: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var String.test4: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
interface IFooStr {
|
||||
abstract fun foo(x: String)
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface IBar {
|
||||
abstract val bar: Int
|
||||
abstract get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
abstract class CFoo<T : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
fun foo(x: T) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Test1 : CFoo<String>, IFooStr, IBar {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
override val bar: Int
|
||||
field = 42
|
||||
override get
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
@file:JvmName(...)
|
||||
|
||||
fun foo() {
|
||||
}
|
||||
|
||||
val bar: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
typealias Bar<T : Any?> = Function1<T, String>
|
||||
@@ -0,0 +1,40 @@
|
||||
class C<T : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
object Delegate {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
set(<set-?>: Int) {
|
||||
return #genericDelegatedProperty$delegate.setValue(thisRef = <this>, kProp = ::genericDelegatedProperty, newValue = <set-?>)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
interface C {
|
||||
abstract val test1: Int
|
||||
abstract get
|
||||
|
||||
val test2: Int
|
||||
get(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
abstract var test3: Int
|
||||
abstract get
|
||||
abstract set
|
||||
|
||||
var test4: Int
|
||||
get(): Int {
|
||||
return 0
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
suspend fun foo() {
|
||||
return baz<Unit>()
|
||||
}
|
||||
|
||||
suspend fun bar(): Any {
|
||||
return baz<Any>()
|
||||
}
|
||||
|
||||
suspend fun <T : Any?> baz(): T {
|
||||
TODO()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package interop
|
||||
|
||||
object Definitions {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
const val KT_CONSTANT: String
|
||||
field = "constant"
|
||||
get
|
||||
|
||||
val ktValue: String
|
||||
field = #CONSTANT
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
interface I {
|
||||
val <T : Any?> T.id: T
|
||||
get(): T {
|
||||
return <this>
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class A : I {
|
||||
constructor(i: I) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
private /*final field*/ val $$delegate_0: I = i
|
||||
override val <T : Any?> T.id: T
|
||||
override get(): T {
|
||||
return #$$delegate_0.<get-id><T>($receiver = <this>)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
fun outer() {
|
||||
local abstract class ALocal {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
abstract fun afun()
|
||||
abstract val aval: Int
|
||||
abstract get
|
||||
|
||||
abstract var avar: Int
|
||||
abstract get
|
||||
abstract set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
local class Local : ALocal {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
override fun afun() {
|
||||
}
|
||||
|
||||
override val aval: Int
|
||||
field = 1
|
||||
override get
|
||||
|
||||
override var avar: Int
|
||||
field = 2
|
||||
override get
|
||||
override set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
fun test1() {
|
||||
val x: Int
|
||||
val x$delegate: Lazy<Int> = lazy<Int>(initializer = local fun <anonymous>(): Int {
|
||||
return 42
|
||||
}
|
||||
)
|
||||
local get(): Int {
|
||||
return getValue<Int>($receiver = x$delegate, 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 getValue<Int, Int>($receiver = x$delegate, thisRef = null, property = ::x)
|
||||
}
|
||||
local set(value: Int) {
|
||||
return setValue<Int>($receiver = x$delegate, thisRef = null, property = ::x, value = value)
|
||||
}
|
||||
|
||||
|
||||
<set-x>(value = 0)
|
||||
{ //BLOCK
|
||||
val tmp0: Int = <get-x>()
|
||||
<set-x>(value = tmp0.inc())
|
||||
tmp0
|
||||
} /*~> Unit */
|
||||
<set-x>(value = <get-x>().plus(other = 1))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo() {
|
||||
{ //BLOCK
|
||||
do// COMPOSITE {
|
||||
val x: Int = 42
|
||||
// } while (EQEQ(arg0 = x, arg1 = 42).not())
|
||||
}
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
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 */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
abstract fun foo()
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
open class B : A {
|
||||
constructor(i: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
override fun foo() {
|
||||
}
|
||||
|
||||
open fun bar(s: String) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
expect enum class MyEnum : Enum<MyEnum> {
|
||||
FOO
|
||||
BAR
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fun values(): Array<MyEnum> /* Synthetic body for ENUM_VALUES */
|
||||
|
||||
fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */
|
||||
|
||||
}
|
||||
|
||||
enum class MyEnum : Enum<MyEnum> {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrEnumConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
FOO init = TODO("IrEnumConstructorCall") BAR init = TODO("IrEnumConstructorCall") BAZ init = TODO("IrEnumConstructorCall")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
fun values(): Array<MyEnum> /* Synthetic body for ENUM_VALUES */
|
||||
|
||||
fun valueOf(value: String): MyEnum /* Synthetic body for ENUM_VALUEOF */
|
||||
|
||||
}
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
expect sealed class Ops {
|
||||
private expect constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
expect class Add : Ops {
|
||||
expect constructor() /* primary */
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
sealed class Ops {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Add : Ops {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
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 getValue<Int>($receiver = #test7$delegate, thisRef = null, property = ::test7)
|
||||
}
|
||||
|
||||
var test8: Int /* by */
|
||||
field = hashMapOf<String, Int>()
|
||||
get(): Int {
|
||||
return getValue<Int, Int>($receiver = #test8$delegate, thisRef = null, property = ::test8)
|
||||
}
|
||||
set(<set-?>: Int) {
|
||||
return setValue<Int>($receiver = #test8$delegate, thisRef = null, property = ::test8, value = <set-?>)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
interface TestInterface<T : Any?> {
|
||||
interface TestNestedInterface<TT : Any?> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Test<T0 : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
class TestNested<T1 : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
inner class TestInner<T2 : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
class Test1<T1 : Any?, T2 : Any?> {
|
||||
constructor(x: T1, y: T2) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: T1
|
||||
field = x
|
||||
get
|
||||
|
||||
val y: T2
|
||||
field = y
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Test2 {
|
||||
constructor(x: Int, y: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val y: String
|
||||
field = y
|
||||
get
|
||||
|
||||
inner class TestInner<Z : Any?> {
|
||||
constructor(z: Z) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val z: Z
|
||||
field = z
|
||||
get
|
||||
|
||||
constructor(z: Z, i: Int) {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Test3 {
|
||||
constructor(x: Int, y: String = "") /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
val y: String
|
||||
field = y
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Test4<T : Any?> {
|
||||
constructor(x: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
constructor(x: Int, y: Int = 42) {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
data class Test<T : Any?> {
|
||||
constructor(x: T, y: String = "") /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: T
|
||||
field = x
|
||||
get
|
||||
|
||||
val y: String
|
||||
field = y
|
||||
get
|
||||
|
||||
operator fun component1(): T {
|
||||
return #x
|
||||
}
|
||||
|
||||
operator fun component2(): String {
|
||||
return #y
|
||||
}
|
||||
|
||||
fun copy(x: T = #x, y: String = #y): Test<T> {
|
||||
return TODO("IrConstructorCall")
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "Test(" +
|
||||
"x=" +
|
||||
#x +
|
||||
", " +
|
||||
"y=" +
|
||||
#y +
|
||||
")"
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return when {
|
||||
EQEQ(arg0 = #x, arg1 = null) -> 0
|
||||
true -> #x.hashCode()
|
||||
}.times(other = 31).plus(other = #y.hashCode())
|
||||
}
|
||||
|
||||
override operator 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 = #x, arg1 = #x).not() -> return false
|
||||
}
|
||||
when {
|
||||
EQEQ(arg0 = #y, arg1 = #y).not() -> return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
val test1: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
var test2: Int
|
||||
field = 42
|
||||
get
|
||||
set
|
||||
|
||||
class Host {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val testMember1: Int
|
||||
field = 42
|
||||
get
|
||||
|
||||
var testMember2: Int
|
||||
field = 42
|
||||
get
|
||||
set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class InPrimaryCtor<T : Any?> {
|
||||
constructor(testInPrimaryCtor1: T, testInPrimaryCtor2: Int = 42) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val testInPrimaryCtor1: T
|
||||
field = testInPrimaryCtor1
|
||||
get
|
||||
|
||||
var testInPrimaryCtor2: Int
|
||||
field = testInPrimaryCtor2
|
||||
get
|
||||
set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
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 */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
private /*final field*/ val $$delegate_0: IBase<TT> = impl
|
||||
override fun <X : Any?> qux(t: TT, x: X) {
|
||||
#$$delegate_0.qux<X>(t = t, x = x)
|
||||
}
|
||||
|
||||
override fun foo(x: Int) {
|
||||
#$$delegate_0.foo(x = x)
|
||||
}
|
||||
|
||||
override val bar: Int
|
||||
override get(): Int {
|
||||
return #$$delegate_0.<get-bar>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
fun <T : Any?> test1(i: Int, j: T) {
|
||||
}
|
||||
|
||||
fun test2(i: Int = 0, j: String = "") {
|
||||
}
|
||||
|
||||
fun test3(vararg args: String) {
|
||||
}
|
||||
|
||||
fun String.textExt1(i: Int, j: String) {
|
||||
}
|
||||
|
||||
class Host {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
fun String.testMembetExt1(i: Int, j: String) {
|
||||
}
|
||||
|
||||
fun <T : Any?> String.testMembetExt2(i: Int, j: T) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
class Outer<T1 : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
inner class Inner<T2 : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
fun foo(x1: T1, x2: T2) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
val test1: Function1<String, String>
|
||||
field = local fun <anonymous>(it: String): String {
|
||||
return it
|
||||
}
|
||||
|
||||
get
|
||||
|
||||
val test2: @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,19 @@
|
||||
fun <TT : Any?> outer() {
|
||||
local fun <T : Any?> test1(i: Int, j: T) {
|
||||
}
|
||||
|
||||
|
||||
local fun test2(i: Int = 0, j: String = "") {
|
||||
}
|
||||
|
||||
|
||||
local fun test3(vararg args: String) {
|
||||
}
|
||||
|
||||
|
||||
local fun String.textExt1(i: Int, j: TT) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
val test1: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var test2: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
val String.testExt1: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var String.testExt2: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
val <T : Any?> T.testExt3: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var <T : Any?> T.testExt4: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
class Host<T : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val testMem1: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var testMem2: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
val String.testMemExt1: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var String.testMemExt2: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
val <TT : Any?> TT.testMemExt3: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
var <TT : Any?> TT.testMemExt4: Int
|
||||
get(): Int {
|
||||
return 42
|
||||
}
|
||||
set(value: Int) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
class Test1<T : U, U : Any?> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun <T : U, U : Any?> test2() {
|
||||
}
|
||||
|
||||
var <T : U, U : Any?> Test1<T, U>.test3: Unit
|
||||
get() {
|
||||
}
|
||||
set(value: Unit) {
|
||||
}
|
||||
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
abstract class Base1<T : Derived1> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Derived1 : Base1<Derived1> {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
abstract class Base2 {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
fun <T : Derived2> foo(x: T) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Derived2 : Base2 {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
fun f(f1: Function0<String> = local fun <anonymous>(): String {
|
||||
return f2.invoke()
|
||||
}
|
||||
, f2: Function0<String> = local fun <anonymous>(): String {
|
||||
return "FAIL"
|
||||
}
|
||||
): String {
|
||||
return f1.invoke()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
var result: String = "fail"
|
||||
try { //BLOCK
|
||||
f() /*~> Unit */
|
||||
}
|
||||
catch (...) { //BLOCK
|
||||
result = "OK"
|
||||
}
|
||||
|
||||
return f(, f2 = local fun <anonymous>(): String {
|
||||
return "O"
|
||||
}
|
||||
).plus(other = f(f1 = local fun <anonymous>(): String {
|
||||
return "K"
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
class Test {
|
||||
constructor(x: Int = 0) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val x: Int
|
||||
field = x
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
class C {
|
||||
constructor(test1: Int, test2: Int) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val test1: Int
|
||||
field = test1
|
||||
get
|
||||
|
||||
var test2: Int
|
||||
field = test2
|
||||
get
|
||||
set
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
class MyClass {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
operator fun MyClass.provideDelegate(host: Any?, p: Any): String {
|
||||
return <this>.<get-value>()
|
||||
}
|
||||
|
||||
operator fun String.getValue(receiver: Any?, p: Any): String {
|
||||
return <this>
|
||||
}
|
||||
|
||||
val testO: String /* by */
|
||||
field = provideDelegate($receiver = TODO("IrConstructorCall"), host = null, p = ::testO)
|
||||
get(): String {
|
||||
return getValue($receiver = #testO$delegate, receiver = null, p = ::testO)
|
||||
}
|
||||
|
||||
val testK: String /* by */
|
||||
field = "K"
|
||||
get(): String {
|
||||
return getValue($receiver = #testK$delegate, receiver = null, p = ::testK)
|
||||
}
|
||||
|
||||
val testOK: String
|
||||
field = <get-testO>().plus(other = <get-testK>())
|
||||
get
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
class Delegate {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
operator fun getValue(thisRef: Any?, property: Any?): String {
|
||||
return <this>.<get-value>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class DelegateProvider {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate {
|
||||
return TODO("IrConstructorCall")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val testMember: String
|
||||
val testMember$delegate: Delegate = TODO("IrConstructorCall").provideDelegate(thisRef = null, property = ::testMember)
|
||||
local get(): String {
|
||||
return testMember$delegate.getValue(thisRef = null, property = ::testMember)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
class MyClass {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
operator fun MyClass.provideDelegate(host: Any?, p: Any): String {
|
||||
return <this>.<get-value>()
|
||||
}
|
||||
|
||||
operator fun String.getValue(receiver: Any?, p: Any): String {
|
||||
return <this>
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val testO: String
|
||||
val testO$delegate: String = provideDelegate($receiver = TODO("IrConstructorCall"), host = null, p = ::testO)
|
||||
local get(): String {
|
||||
return getValue($receiver = testO$delegate, receiver = null, p = ::testO)
|
||||
}
|
||||
|
||||
|
||||
val testK: String
|
||||
val testK$delegate: String = "K"
|
||||
local get(): String {
|
||||
return getValue($receiver = testK$delegate, receiver = null, p = ::testK)
|
||||
}
|
||||
|
||||
|
||||
val testOK: String = <get-testO>().plus(other = <get-testK>())
|
||||
return testOK
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
class Delegate {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
operator fun getValue(thisRef: Any?, property: Any?): String {
|
||||
return <this>.<get-value>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class DelegateProvider {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate {
|
||||
return TODO("IrConstructorCall")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class Host {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val testMember: String /* by */
|
||||
field = TODO("IrConstructorCall").provideDelegate(thisRef = <this>, property = ::testMember)
|
||||
get(): String {
|
||||
return #testMember$delegate.getValue(thisRef = <this>, property = ::testMember)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
object Host {
|
||||
private constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
class StringDelegate {
|
||||
constructor(s: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
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 TODO("IrConstructorCall")
|
||||
}
|
||||
|
||||
val String.plusK: String /* by */
|
||||
field = <this>.provideDelegate($receiver = "K", host = <this>, p = ::plusK)
|
||||
get(): String {
|
||||
return #plusK$delegate.getValue(receiver = <this>, p = ::plusK)
|
||||
}
|
||||
|
||||
val ok: String
|
||||
field = <this>.<get-plusK>($receiver = "O")
|
||||
get
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
class Delegate {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
operator fun getValue(thisRef: Any?, property: Any?): String {
|
||||
return <this>.<get-value>()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
class DelegateProvider {
|
||||
constructor(value: String) /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
val value: String
|
||||
field = value
|
||||
get
|
||||
|
||||
operator fun provideDelegate(thisRef: Any?, property: Any?): Delegate {
|
||||
return TODO("IrConstructorCall")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
val testTopLevel: String /* by */
|
||||
field = TODO("IrConstructorCall").provideDelegate(thisRef = null, property = ::testTopLevel)
|
||||
get(): String {
|
||||
return #testTopLevel$delegate.getValue(thisRef = null, property = ::testTopLevel)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
typealias Test1 = String
|
||||
fun foo() {
|
||||
{ //BLOCK
|
||||
}
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
@Suppress(...)
|
||||
typealias TestNested = String
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user