Generate delegating constructor calls as IrDelegatingConstructorCall expressions

(they have different platform-level representation in JVM and JS).
This commit is contained in:
Dmitry Petrov
2016-08-30 11:02:54 +03:00
committed by Dmitry Petrov
parent 6fbac2ed40
commit a6bee7a22b
22 changed files with 224 additions and 142 deletions
@@ -0,0 +1,50 @@
FILE /argumentReorderingInDelegatingConstructorCall.kt
CLASS CLASS Base
FUN public constructor Base(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int)
BLOCK_BODY
SET_BACKING_FIELD x type=kotlin.Unit operator=null
GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
SET_BACKING_FIELD y type=kotlin.Unit operator=null
GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final val x: kotlin.Int getter=null setter=null
EXPRESSION_BODY
GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
PROPERTY public final val y: kotlin.Int getter=null setter=null
EXPRESSION_BODY
GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
CLASS CLASS Test1
FUN public constructor Test1(/*0*/ xx: kotlin.Int, /*1*/ yy: kotlin.Int)
BLOCK_BODY
BLOCK type=Base operator=ARGUMENTS_REORDERING_FOR_CALL
VAR val tmp0_y: kotlin.Int
GET_VAR yy type=kotlin.Int operator=null
VAR val tmp1_x: kotlin.Int
GET_VAR xx type=kotlin.Int operator=null
CALL .<init> type=Base operator=SUPER_CONSTRUCTOR_CALL
x: GET_VAR tmp1_x type=kotlin.Int operator=null
y: GET_VAR tmp0_y type=kotlin.Int operator=null
CLASS CLASS Test2
nestedInitializers: BLOCK_BODY
FUN public constructor Test2(/*0*/ xx: kotlin.Int, /*1*/ yy: kotlin.Int)
BLOCK_BODY
BLOCK type=Base operator=ARGUMENTS_REORDERING_FOR_CALL
VAR val tmp0_y: kotlin.Int
GET_VAR yy type=kotlin.Int operator=null
VAR val tmp1_x: kotlin.Int
GET_VAR xx type=kotlin.Int operator=null
TYPE_OP operator=IMPLICIT_CAST typeOperand=Base
DELEGATING_CONSTRUCTOR_CALL Base
x: GET_VAR tmp1_x type=kotlin.Int operator=null
y: GET_VAR tmp0_y type=kotlin.Int operator=null
NESTED_INITIALIZERS_CALL classDescriptor=Test2
FUN public constructor Test2(/*0*/ xxx: kotlin.Int, /*1*/ yyy: kotlin.Int, /*2*/ a: kotlin.Any)
BLOCK_BODY
BLOCK type=Test2 operator=ARGUMENTS_REORDERING_FOR_CALL
VAR val tmp0_yy: kotlin.Int
GET_VAR yyy type=kotlin.Int operator=null
VAR val tmp1_xx: kotlin.Int
GET_VAR xxx type=kotlin.Int operator=null
TYPE_OP operator=IMPLICIT_CAST typeOperand=Test2
DELEGATING_CONSTRUCTOR_CALL Test2
xx: GET_VAR tmp1_xx type=kotlin.Int operator=null
yy: GET_VAR tmp0_yy type=kotlin.Int operator=null