[fir2ir] Set origins for componentN and copy methods of data classes

This aligns the behavior with psi2ir.
This commit is contained in:
Sergej Jaskiewicz
2023-04-06 14:33:36 +02:00
committed by Space Team
parent c718c77c43
commit 4b6975c3d0
26 changed files with 92 additions and 89 deletions
@@ -25,13 +25,13 @@ FILE fqName:<root> fileName:/arrayAccessCompositeOperators.kt
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.<set-i>' type=<root>.MyContainer origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.MyContainer.<set-i>' type=kotlin.Int origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.Int [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.MyContainer'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.component1' type=<root>.MyContainer origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.MyContainer, i:kotlin.Int) returnType:<root>.MyContainer
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.MyContainer, i:kotlin.Int) returnType:<root>.MyContainer
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
VALUE_PARAMETER name:i index:0 type:kotlin.Int
EXPRESSION_BODY
@@ -25,13 +25,13 @@ FILE fqName:<root> fileName:/arrayAccessOperators.kt
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.<set-s>' type=<root>.MyContainer origin=null
value: GET_VAR '<set-?>: kotlin.String declared in <root>.MyContainer.<set-s>' type=kotlin.String origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.String [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.MyContainer) returnType:kotlin.String [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.String [operator] declared in <root>.MyContainer'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String visibility:private' type=kotlin.String origin=null
receiver: GET_VAR '<this>: <root>.MyContainer declared in <root>.MyContainer.component1' type=<root>.MyContainer origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.MyContainer, s:kotlin.String) returnType:<root>.MyContainer
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.MyContainer, s:kotlin.String) returnType:<root>.MyContainer
$this: VALUE_PARAMETER name:<this> type:<root>.MyContainer
VALUE_PARAMETER name:s index:0 type:kotlin.String
EXPRESSION_BODY
@@ -25,13 +25,13 @@ FILE fqName:<root> fileName:/compoundAssignmentOperators.kt
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<set-i>' type=<root>.Result origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.Result.<set-i>' type=kotlin.Int origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Result
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.Result'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.component1' type=<root>.Result origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Result, i:kotlin.Int) returnType:<root>.Result
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.Result, i:kotlin.Int) returnType:<root>.Result
$this: VALUE_PARAMETER name:<this> type:<root>.Result
VALUE_PARAMETER name:i index:0 type:kotlin.Int
EXPRESSION_BODY
@@ -31,19 +31,19 @@ FILE fqName:<root> fileName:/compareTo.kt
RETURN type=kotlin.Nothing from='public final fun <get-second> (): B of <root>.Pair declared in <root>.Pair'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.<get-second>' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:A of <root>.Pair [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:A of <root>.Pair [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): A of <root>.Pair [operator] declared in <root>.Pair'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:first type:A of <root>.Pair visibility:private [final]' type=A of <root>.Pair origin=null
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.component1' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
FUN name:component2 visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:B of <root>.Pair [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>) returnType:B of <root>.Pair [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component2 (): B of <root>.Pair [operator] declared in <root>.Pair'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:second type:B of <root>.Pair visibility:private [final]' type=B of <root>.Pair origin=null
receiver: GET_VAR '<this>: <root>.Pair<A of <root>.Pair, B of <root>.Pair> declared in <root>.Pair.component2' type=<root>.Pair<A of <root>.Pair, B of <root>.Pair> origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>, first:A of <root>.Pair, second:B of <root>.Pair) returnType:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.Pair<A of <root>.Pair, B of <root>.Pair>, first:A of <root>.Pair, second:B of <root>.Pair) returnType:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
$this: VALUE_PARAMETER name:<this> type:<root>.Pair<A of <root>.Pair, B of <root>.Pair>
VALUE_PARAMETER name:first index:0 type:A of <root>.Pair
EXPRESSION_BODY
@@ -27,13 +27,13 @@ FILE fqName:<root> fileName:/iteratorOperator.kt
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.<set-i>' type=<root>.Counter origin=null
value: GET_VAR '<set-?>: kotlin.Int declared in <root>.Counter.<set-i>' type=kotlin.Int origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Counter) returnType:kotlin.Int [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.Counter) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Counter
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.Counter'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Counter declared in <root>.Counter.component1' type=<root>.Counter origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Counter, i:kotlin.Int) returnType:<root>.Counter
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.Counter, i:kotlin.Int) returnType:<root>.Counter
$this: VALUE_PARAMETER name:<this> type:<root>.Counter
VALUE_PARAMETER name:i index:0 type:kotlin.Int
EXPRESSION_BODY
@@ -117,13 +117,13 @@ FILE fqName:<root> fileName:/iteratorOperator.kt
RETURN type=kotlin.Nothing from='public final fun <get-max> (): kotlin.Int declared in <root>.CounterConfig'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.<get-max>' type=<root>.CounterConfig origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.CounterConfig) returnType:kotlin.Int [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.CounterConfig) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.CounterConfig
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.CounterConfig'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:max type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.CounterConfig declared in <root>.CounterConfig.component1' type=<root>.CounterConfig origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.CounterConfig, max:kotlin.Int) returnType:<root>.CounterConfig
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.CounterConfig, max:kotlin.Int) returnType:<root>.CounterConfig
$this: VALUE_PARAMETER name:<this> type:<root>.CounterConfig
VALUE_PARAMETER name:max index:0 type:kotlin.Int
EXPRESSION_BODY
@@ -17,13 +17,13 @@ FILE fqName:<root> fileName:/unaryOperators.kt
RETURN type=kotlin.Nothing from='public final fun <get-i> (): kotlin.Int declared in <root>.Result'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.<get-i>' type=<root>.Result origin=null
FUN name:component1 visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int [operator]
FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:<root>.Result) returnType:kotlin.Int [operator]
$this: VALUE_PARAMETER name:<this> type:<root>.Result
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in <root>.Result'
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:i type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null
receiver: GET_VAR '<this>: <root>.Result declared in <root>.Result.component1' type=<root>.Result origin=null
FUN name:copy visibility:public modality:FINAL <> ($this:<root>.Result, i:kotlin.Int) returnType:<root>.Result
FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:<root>.Result, i:kotlin.Int) returnType:<root>.Result
$this: VALUE_PARAMETER name:<this> type:<root>.Result
VALUE_PARAMETER name:i index:0 type:kotlin.Int
EXPRESSION_BODY