Property initializers from primary constructor parameters
are generated as property initializer expressions and should not be repeated in primary constructor.
This commit is contained in:
committed by
Dmitry Petrov
parent
a9dbaca473
commit
8fc16345e6
-6
@@ -3,12 +3,6 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt
|
||||
CONSTRUCTOR public constructor Base(x: kotlin.Int, y: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Base' type=Base
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Base' type=Base
|
||||
value: GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Base'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -5,12 +5,6 @@ FILE /classMembers.kt
|
||||
CONST Int type=kotlin.Int value='1'
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'C' type=C
|
||||
value: GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'z: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'C' type=C
|
||||
value: GET_VAR 'value-parameter z: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='C'
|
||||
PROPERTY public final val y: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -3,15 +3,6 @@ FILE /dataClasses.kt
|
||||
CONSTRUCTOR public constructor Test1(x: kotlin.Int, y: kotlin.String, z: kotlin.Any)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test1' type=Test1
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'y: String' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test1' type=Test1
|
||||
value: GET_VAR 'value-parameter y: String' type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'z: Any' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test1' type=Test1
|
||||
value: GET_VAR 'value-parameter z: Any' type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Test1'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -16,9 +16,6 @@ FILE /enum.kt
|
||||
CONSTRUCTOR private constructor TestEnum2(x: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)' super
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'TestEnum2' type=TestEnum2
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='TestEnum2'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
@@ -61,9 +58,6 @@ FILE /enum.kt
|
||||
CONSTRUCTOR private constructor TestEnum4(x: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'constructor Enum(String, Int)' super
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'TestEnum4' type=TestEnum4
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='TestEnum4'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -11,9 +11,6 @@ FILE /initBlock.kt
|
||||
CONSTRUCTOR public constructor Test2(x: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test2' type=Test2
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Test2'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -3,9 +3,6 @@ FILE /initVal.kt
|
||||
CONSTRUCTOR public constructor TestInitValFromParameter(x: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'TestInitValFromParameter' type=TestInitValFromParameter
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='TestInitValFromParameter'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -3,9 +3,6 @@ FILE /initVar.kt
|
||||
CONSTRUCTOR public constructor TestInitVarFromParameter(x: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='TestInitVarFromParameter'
|
||||
PROPERTY public final var x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -3,12 +3,6 @@ FILE /primaryConstructor.kt
|
||||
CONSTRUCTOR public constructor Test1(x: kotlin.Int, y: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test1' type=Test1
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test1' type=Test1
|
||||
value: GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Test1'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
@@ -20,9 +14,6 @@ FILE /primaryConstructor.kt
|
||||
CONSTRUCTOR public constructor Test2(x: kotlin.Int, y: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test2' type=Test2
|
||||
value: GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Test2'
|
||||
PROPERTY public final val y: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
@@ -34,9 +25,6 @@ FILE /primaryConstructor.kt
|
||||
CONSTRUCTOR public constructor Test3(x: kotlin.Int, y: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||
SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Test3' type=Test3
|
||||
value: GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Test3'
|
||||
PROPERTY public final val y: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
-6
@@ -18,12 +18,6 @@ FILE /primaryConstructorWithSuperConstructorCall.kt
|
||||
CONSTRUCTOR public constructor TestWithDelegatingConstructor(x: kotlin.Int, y: kotlin.Int)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Base()'
|
||||
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
|
||||
value: GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'y: Int' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
|
||||
value: GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='TestWithDelegatingConstructor'
|
||||
PROPERTY public final val x: kotlin.Int
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -8,9 +8,6 @@ FILE /sealedClasses.kt
|
||||
CONSTRUCTOR public constructor Const(number: kotlin.Double)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Expr()'
|
||||
SET_BACKING_FIELD 'number: Double' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Const' type=Expr.Const
|
||||
value: GET_VAR 'value-parameter number: Double' type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Const'
|
||||
PROPERTY public final val number: kotlin.Double
|
||||
EXPRESSION_BODY
|
||||
@@ -19,12 +16,6 @@ FILE /sealedClasses.kt
|
||||
CONSTRUCTOR public constructor Sum(e1: Expr, e2: Expr)
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'constructor Expr()'
|
||||
SET_BACKING_FIELD 'e1: Expr' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Sum' type=Expr.Sum
|
||||
value: GET_VAR 'value-parameter e1: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
SET_BACKING_FIELD 'e2: Expr' type=kotlin.Unit operator=null
|
||||
receiver: THIS of 'Sum' type=Expr.Sum
|
||||
value: GET_VAR 'value-parameter e2: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='Sum'
|
||||
PROPERTY public final val e1: Expr
|
||||
EXPRESSION_BODY
|
||||
|
||||
Reference in New Issue
Block a user