[FIR2IR] Support argument reordering of constructor calls
This commit is contained in:
committed by
Mikhail Glukhikh
parent
bae41ddf6d
commit
e954aea4cc
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
var result = "fail"
|
||||
|
||||
open class Base(val o: String, val k: String)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
var result = "fail"
|
||||
|
||||
open class Base(val o: String, val k: String)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JS
|
||||
fun f(): String = "O"
|
||||
fun g(): String = "K"
|
||||
|
||||
Vendored
-1
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
open class A(val a: String, val b: Int)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
open class Base(val addr: Long, val name: String)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
abstract class Base(val s: String, vararg ints: Int)
|
||||
|
||||
fun foo(s: String, ints: IntArray) = object : Base(ints = *ints, s = s) {}
|
||||
|
||||
+16
-6
@@ -48,9 +48,14 @@ FILE fqName:<root> fileName:/argumentReorderingInDelegatingConstructorCall.kt
|
||||
VALUE_PARAMETER name:xx index:0 type:kotlin.Int
|
||||
VALUE_PARAMETER name:yy index:1 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.Base'
|
||||
x: GET_VAR 'yy: kotlin.Int declared in <root>.Test1.<init>' type=kotlin.Int origin=null
|
||||
y: GET_VAR 'xx: kotlin.Int declared in <root>.Test1.<init>' type=kotlin.Int origin=null
|
||||
BLOCK type=<root>.Base origin=ARGUMENTS_REORDERING_FOR_CALL
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
|
||||
GET_VAR 'yy: kotlin.Int declared in <root>.Test1.<init>' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
GET_VAR 'xx: kotlin.Int declared in <root>.Test1.<init>' type=kotlin.Int origin=null
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.Base'
|
||||
x: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.Test1.<init>' type=kotlin.Int origin=null
|
||||
y: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.Test1.<init>' type=kotlin.Int origin=null
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[<root>.Base]'
|
||||
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
|
||||
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Base) returnType:kotlin.Int [fake_override]
|
||||
@@ -90,9 +95,14 @@ FILE fqName:<root> fileName:/argumentReorderingInDelegatingConstructorCall.kt
|
||||
VALUE_PARAMETER name:yyy index:1 type:kotlin.Int
|
||||
VALUE_PARAMETER name:a index:2 type:kotlin.Any
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (xx: kotlin.Int, yy: kotlin.Int) declared in <root>.Test2'
|
||||
xx: GET_VAR 'yyy: kotlin.Int declared in <root>.Test2.<init>' type=kotlin.Int origin=null
|
||||
yy: GET_VAR 'xxx: kotlin.Int declared in <root>.Test2.<init>' type=kotlin.Int origin=null
|
||||
BLOCK type=<root>.Test2 origin=ARGUMENTS_REORDERING_FOR_CALL
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val]
|
||||
GET_VAR 'yyy: kotlin.Int declared in <root>.Test2.<init>' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [val]
|
||||
GET_VAR 'xxx: kotlin.Int declared in <root>.Test2.<init>' type=kotlin.Int origin=null
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> (xx: kotlin.Int, yy: kotlin.Int) declared in <root>.Test2'
|
||||
xx: GET_VAR 'val tmp_3: kotlin.Int [val] declared in <root>.Test2.<init>' type=kotlin.Int origin=null
|
||||
yy: GET_VAR 'val tmp_2: kotlin.Int [val] declared in <root>.Test2.<init>' type=kotlin.Int origin=null
|
||||
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
|
||||
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:FINAL <> ($this:<root>.Base) returnType:kotlin.Int [fake_override]
|
||||
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
|
||||
|
||||
+8
-3
@@ -790,9 +790,14 @@ FILE fqName:<root> fileName:/enum.kt
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.TestEnum6.TEST
|
||||
CONSTRUCTOR visibility:private <> () returnType:<root>.TestEnum6.TEST [primary]
|
||||
BLOCK_BODY
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.TestEnum6'
|
||||
x: CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
y: CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
BLOCK type=<root>.TestEnum6 origin=ARGUMENTS_REORDERING_FOR_CALL
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val]
|
||||
CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'public final fun f (): kotlin.Int declared in <root>' type=kotlin.Int origin=null
|
||||
ENUM_CONSTRUCTOR_CALL 'private constructor <init> (x: kotlin.Int, y: kotlin.Int) [primary] declared in <root>.TestEnum6'
|
||||
x: GET_VAR 'val tmp_1: kotlin.Int [val] declared in <root>.TestEnum6.TEST.<init>' type=kotlin.Int origin=null
|
||||
y: GET_VAR 'val tmp_0: kotlin.Int [val] declared in <root>.TestEnum6.TEST.<init>' type=kotlin.Int origin=null
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST modality:FINAL visibility:private superTypes:[<root>.TestEnum6]'
|
||||
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val]
|
||||
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:FINAL <> ($this:<root>.TestEnum6) returnType:kotlin.Int [fake_override]
|
||||
|
||||
Reference in New Issue
Block a user