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