Properties declared in primary constructors should have proper accessors in IR.

This commit is contained in:
Dmitry Petrov
2016-09-12 12:22:08 +03:00
committed by Dmitry Petrov
parent 5c720845a8
commit 201d2414bc
26 changed files with 649 additions and 121 deletions
@@ -8,10 +8,20 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'Base' type=Base
PROPERTY public final val y: kotlin.Int
FIELD public final val y: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
receiver: THIS of 'Base' type=Base
CLASS CLASS Test1
CONSTRUCTOR public constructor Test1(xx: kotlin.Int, yy: kotlin.Int)
BLOCK_BODY
+15
View File
@@ -10,10 +10,25 @@ FILE /classMembers.kt
FIELD public final val y: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
PROPERTY public final var z: kotlin.Int
FIELD public final var z: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter z: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-z>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z>(): Int'
GET_BACKING_FIELD 'z: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
FUN public final fun <set-z>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'z: Int' type=kotlin.Unit operator=null
receiver: THIS of 'C' type=C
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
CONSTRUCTOR public constructor C()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor C(Int, Int, Int = ...)'
+15
View File
@@ -8,14 +8,29 @@ FILE /dataClasses.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'Test1' type=Test1
PROPERTY public final val y: kotlin.String
FIELD public final val y: kotlin.String
EXPRESSION_BODY
GET_VAR 'value-parameter y: String' type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): String'
GET_BACKING_FIELD 'y: String' type=kotlin.String operator=null
receiver: THIS of 'Test1' type=Test1
PROPERTY public final val z: kotlin.Any
FIELD public final val z: kotlin.Any
EXPRESSION_BODY
GET_VAR 'value-parameter z: Any' type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-z>(): kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-z>(): Any'
GET_BACKING_FIELD 'z: Any' type=kotlin.Any operator=null
receiver: THIS of 'Test1' type=Test1
FUN public final operator fun component1(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='component1(): Int'
+10
View File
@@ -21,6 +21,11 @@ FILE /enum.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'TestEnum2' type=TestEnum2
ENUM_ENTRY enum entry TEST1
init: ENUM_CONSTRUCTOR_CALL 'constructor TestEnum2(Int)' TEST1
x: CONST Int type=kotlin.Int value='1'
@@ -64,6 +69,11 @@ FILE /enum.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'TestEnum4' type=TestEnum4
ENUM_ENTRY enum entry TEST1
init: ENUM_CONSTRUCTOR_CALL 'constructor TEST1()' TEST1
class: CLASS ENUM_ENTRY TEST1
+5
View File
@@ -16,6 +16,11 @@ FILE /initBlock.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'Test2' type=Test2
ANONYMOUS_INITIALIZER Test2
BLOCK_BODY
CALL 'println(): Unit' type=kotlin.Unit operator=null
+5
View File
@@ -8,6 +8,11 @@ FILE /initVal.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'TestInitValFromParameter' type=TestInitValFromParameter
CLASS CLASS TestInitValInClass
CONSTRUCTOR public constructor TestInitValInClass()
BLOCK_BODY
+10
View File
@@ -8,6 +8,16 @@ FILE /initVar.kt
FIELD public final var x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
FUN public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
CLASS CLASS TestInitVarInClass
CONSTRUCTOR public constructor TestInitVarInClass()
BLOCK_BODY
@@ -8,10 +8,20 @@ FILE /primaryConstructor.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'Test1' type=Test1
PROPERTY public final val y: kotlin.Int
FIELD public final val y: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
receiver: THIS of 'Test1' type=Test1
CLASS CLASS Test2
CONSTRUCTOR public constructor Test2(x: kotlin.Int, y: kotlin.Int)
BLOCK_BODY
@@ -21,6 +31,11 @@ FILE /primaryConstructor.kt
FIELD public final val y: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
receiver: THIS of 'Test2' type=Test2
PROPERTY public final val x: kotlin.Int
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
@@ -39,6 +54,11 @@ FILE /primaryConstructor.kt
FIELD public final val y: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
receiver: THIS of 'Test3' type=Test3
PROPERTY public final val x: kotlin.Int
FIELD public final val x: kotlin.Int
FUN public final fun <get-x>(): kotlin.Int
@@ -23,10 +23,20 @@ FILE /primaryConstructorWithSuperConstructorCall.kt
FIELD public final val x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
PROPERTY public final val y: kotlin.Int
FIELD public final val y: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-y>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-y>(): Int'
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
CONSTRUCTOR public constructor TestWithDelegatingConstructor(x: kotlin.Int)
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor TestWithDelegatingConstructor(Int, Int)'
+15
View File
@@ -13,6 +13,11 @@ FILE /sealedClasses.kt
FIELD public final val number: kotlin.Double
EXPRESSION_BODY
GET_VAR 'value-parameter number: Double' type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-number>(): kotlin.Double
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-number>(): Double'
GET_BACKING_FIELD 'number: Double' type=kotlin.Double operator=null
receiver: THIS of 'Const' type=Expr.Const
CLASS CLASS Sum
CONSTRUCTOR public constructor Sum(e1: Expr, e2: Expr)
BLOCK_BODY
@@ -22,10 +27,20 @@ FILE /sealedClasses.kt
FIELD public final val e1: Expr
EXPRESSION_BODY
GET_VAR 'value-parameter e1: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-e1>(): Expr
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-e1>(): Expr'
GET_BACKING_FIELD 'e1: Expr' type=Expr operator=null
receiver: THIS of 'Sum' type=Expr.Sum
PROPERTY public final val e2: Expr
FIELD public final val e2: Expr
EXPRESSION_BODY
GET_VAR 'value-parameter e2: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-e2>(): Expr
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-e2>(): Expr'
GET_BACKING_FIELD 'e2: Expr' type=Expr operator=null
receiver: THIS of 'Sum' type=Expr.Sum
CLASS OBJECT NotANumber
CONSTRUCTOR private constructor NotANumber()
BLOCK_BODY
@@ -0,0 +1,21 @@
// WITH_RUNTIME
class C {
val test1 = 0
val test2: Int get() = 0
var test3 = 0
var test4 = 1; set(value) {
field = value
}
var test5 = 1; private set
val test6 = 1; get
val test7 by lazy { 42 }
var test8 by hashMapOf<String, Int>()
}
@@ -0,0 +1,109 @@
FILE /classLevelProperties.kt
CLASS CLASS C
CONSTRUCTOR public constructor C()
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='C'
PROPERTY public final val test1: kotlin.Int = 0
FIELD public final val test1: kotlin.Int = 0
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
FUN public final fun <get-test1>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
PROPERTY public final val test2: kotlin.Int
FUN public final fun <get-test2>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
CONST Int type=kotlin.Int value='0'
PROPERTY public final var test3: kotlin.Int
FIELD public final var test3: kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
FUN public final fun <get-test3>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): Int'
GET_BACKING_FIELD 'test3: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
FUN public final fun <set-test3>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit operator=null
receiver: THIS of 'C' type=C
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
PROPERTY public final var test4: kotlin.Int
FIELD public final var test4: kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
FUN public final fun <get-test4>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test4>(): Int'
GET_BACKING_FIELD 'test4: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
FUN public final fun <set-test4>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit operator=EQ
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null
PROPERTY public final var test5: kotlin.Int
FIELD public final var test5: kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
FUN public final fun <get-test5>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test5>(): Int'
GET_BACKING_FIELD 'test5: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
FUN private final fun <set-test5>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit operator=null
receiver: THIS of 'C' type=C
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
PROPERTY public final val test6: kotlin.Int = 1
FIELD public final val test6: kotlin.Int = 1
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
FUN public final fun <get-test6>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test6>(): Int'
GET_BACKING_FIELD 'test6: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
PROPERTY public final val test7: kotlin.Int
FIELD val `test7$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
FUN local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>(): Int'
CONST Int type=kotlin.Int value='42'
CALLABLE_REFERENCE '<anonymous>(): Int' type=() -> kotlin.Int operator=LAMBDA
FUN public final fun <get-test7>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test7>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int operator=null
$receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public final var test8: kotlin.Int
FIELD val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
EXPRESSION_BODY
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
FUN public final fun <get-test8>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int operator=null
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
FUN public final fun <set-test8>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit operator=null
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
receiver: THIS of 'C' type=C
thisRef: THIS of 'C' type=C
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
@@ -25,6 +25,11 @@ FILE /delegatedProperties.kt
FIELD public final val map: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
EXPRESSION_BODY
GET_VAR 'value-parameter map: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-map>(): kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-map>(): MutableMap<String, Any>'
GET_BACKING_FIELD 'map: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=null
receiver: THIS of 'C' type=C
PROPERTY public final val test2: kotlin.Int
FIELD val `test2$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
@@ -0,0 +1,17 @@
// WITH_RUNTIME
val test1 = 0
val test2: Int get() = 0
var test3 = 0
var test4 = 1; set(value) { field = value }
var test5 = 1; private set
val test6 = 1; get
val test7 by lazy { 42 }
var test8 by hashMapOf<String, Int>()
@@ -0,0 +1,94 @@
FILE /packageLevelProperties.kt
PROPERTY public val test1: kotlin.Int = 0
FIELD public val test1: kotlin.Int = 0
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
FUN public fun <get-test1>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null
PROPERTY public val test2: kotlin.Int
FUN public fun <get-test2>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
CONST Int type=kotlin.Int value='0'
PROPERTY public var test3: kotlin.Int
FIELD public var test3: kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value='0'
FUN public fun <get-test3>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test3>(): Int'
GET_BACKING_FIELD 'test3: Int' type=kotlin.Int operator=null
FUN public fun <set-test3>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit operator=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
PROPERTY public var test4: kotlin.Int
FIELD public var test4: kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
FUN public fun <get-test4>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test4>(): Int'
GET_BACKING_FIELD 'test4: Int' type=kotlin.Int operator=null
FUN public fun <set-test4>(value: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit operator=EQ
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null
PROPERTY public var test5: kotlin.Int
FIELD public var test5: kotlin.Int
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
FUN public fun <get-test5>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test5>(): Int'
GET_BACKING_FIELD 'test5: Int' type=kotlin.Int operator=null
FUN private fun <set-test5>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit operator=null
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
PROPERTY public val test6: kotlin.Int = 1
FIELD public val test6: kotlin.Int = 1
EXPRESSION_BODY
CONST Int type=kotlin.Int value='1'
FUN public fun <get-test6>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test6>(): Int'
GET_BACKING_FIELD 'test6: Int' type=kotlin.Int operator=null
PROPERTY public val test7: kotlin.Int
FIELD val `test7$delegate`: kotlin.Lazy<kotlin.Int>
EXPRESSION_BODY
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
FUN local final fun <anonymous>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<anonymous>(): Int'
CONST Int type=kotlin.Int value='42'
CALLABLE_REFERENCE '<anonymous>(): Int' type=() -> kotlin.Int operator=LAMBDA
FUN public fun <get-test7>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test7>(): Int'
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int operator=null
$receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
PROPERTY public var test8: kotlin.Int
FIELD val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
EXPRESSION_BODY
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
FUN public fun <get-test8>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int operator=null
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
FUN public fun <set-test8>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit operator=null
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
thisRef: CONST Null type=kotlin.Nothing? value='null'
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
@@ -0,0 +1,4 @@
class C(
val test1: Int,
var test2: Int
)
@@ -0,0 +1,29 @@
FILE /primaryCtorProperties.kt
CLASS CLASS C
CONSTRUCTOR public constructor C(test1: kotlin.Int, test2: kotlin.Int)
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
INSTANCE_INITIALIZER_CALL classDescriptor='C'
PROPERTY public final val test1: kotlin.Int
FIELD public final val test1: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter test1: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-test1>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
PROPERTY public final var test2: kotlin.Int
FIELD public final var test2: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter test2: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-test2>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
GET_BACKING_FIELD 'test2: Int' type=kotlin.Int operator=null
receiver: THIS of 'C' type=C
FUN public final fun <set-test2>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'test2: Int' type=kotlin.Unit operator=null
receiver: THIS of 'C' type=C
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
@@ -20,6 +20,11 @@ FILE /arrayAugmentedAssignment1.kt
FIELD public final val x: kotlin.IntArray
EXPRESSION_BODY
GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.IntArray
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): IntArray'
GET_BACKING_FIELD 'x: IntArray' type=kotlin.IntArray operator=null
receiver: THIS of 'C' type=C
FUN public fun testVariable(): kotlin.Unit
BLOCK_BODY
VAR var x: kotlin.IntArray
+10
View File
@@ -8,6 +8,16 @@ FILE /assignments.kt
FIELD public final var x: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-x>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-x>(): Int'
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
receiver: THIS of 'Ref' type=Ref
FUN public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
receiver: THIS of 'Ref' type=Ref
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
FUN public fun test1(): kotlin.Unit
BLOCK_BODY
VAR var x: kotlin.Int
@@ -130,6 +130,16 @@ FILE /complexAugmentedAssignment.kt
FIELD public final var s: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter s: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-s>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-s>(): Int'
GET_BACKING_FIELD 's: Int' type=kotlin.Int operator=null
receiver: THIS of 'B' type=B
FUN public final fun <set-s>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 's: Int' type=kotlin.Unit operator=null
receiver: THIS of 'B' type=B
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
CLASS OBJECT Host
CONSTRUCTOR private constructor Host()
BLOCK_BODY
@@ -13,6 +13,16 @@ FILE /forWithImplicitReceivers.kt
FIELD public final var value: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-value>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-value>(): Int'
GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=null
receiver: THIS of 'IntCell' type=IntCell
FUN public final fun <set-value>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=null
receiver: THIS of 'IntCell' type=IntCell
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
CLASS INTERFACE IReceiver
FUN public open operator fun FiveTimes.iterator(): IntCell
BLOCK_BODY
+10
View File
@@ -8,6 +8,16 @@ FILE /safeCalls.kt
FIELD public final var value: kotlin.Int
EXPRESSION_BODY
GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
FUN public final fun <get-value>(): kotlin.Int
BLOCK_BODY
RETURN type=kotlin.Nothing from='<get-value>(): Int'
GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=null
receiver: THIS of 'Ref' type=Ref
FUN public final fun <set-value>(<set-?>: kotlin.Int): kotlin.Unit
BLOCK_BODY
SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=null
receiver: THIS of 'Ref' type=Ref
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
CLASS INTERFACE IHost
FUN public open fun kotlin.String.extLength(): kotlin.Int
BLOCK_BODY