FIR: Fix interface delegation ABI

- Unifies the name of the `$$delegate_<n>` field between K1 and K2.
- Make the `$$delegate_<n>` field private
This commit is contained in:
Steven Schäfer
2022-11-16 18:27:56 +01:00
committed by Space Team
parent 91749737f8
commit a7ba081d22
44 changed files with 232 additions and 233 deletions
@@ -70,7 +70,7 @@ FILE fqName:<root> fileName:/annotationsOnDelegatedMembers.kt
$this: VALUE_PARAMETER name:<this> type:<root>.DFoo
BLOCK_BODY
CALL 'public abstract fun testFun (): kotlin.Unit declared in <root>.IFoo' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]' type=<root>.IFoo origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.DFoo declared in <root>.DFoo.testFun' type=<root>.DFoo origin=null
FUN DELEGATED_MEMBER name:testExtFun visibility:public modality:OPEN <> ($this:<root>.DFoo, $receiver:kotlin.String) returnType:kotlin.Unit
annotations:
@@ -81,7 +81,7 @@ FILE fqName:<root> fileName:/annotationsOnDelegatedMembers.kt
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
BLOCK_BODY
CALL 'public abstract fun testExtFun (): kotlin.Unit declared in <root>.IFoo' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]' type=<root>.IFoo origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.DFoo declared in <root>.DFoo.testExtFun' type=<root>.DFoo origin=null
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.DFoo.testExtFun' type=kotlin.String origin=null
PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val]
@@ -97,7 +97,7 @@ FILE fqName:<root> fileName:/annotationsOnDelegatedMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-testVal> (): kotlin.String declared in <root>.DFoo'
CALL 'public abstract fun <get-testVal> (): kotlin.String declared in <root>.IFoo' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]' type=<root>.IFoo origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.DFoo declared in <root>.DFoo.<get-testVal>' type=<root>.DFoo origin=null
PROPERTY DELEGATED_MEMBER name:testExtVal visibility:public modality:OPEN [val]
annotations:
@@ -113,10 +113,10 @@ FILE fqName:<root> fileName:/annotationsOnDelegatedMembers.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-testExtVal> (): kotlin.String declared in <root>.DFoo'
CALL 'public abstract fun <get-testExtVal> (): kotlin.String declared in <root>.IFoo' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]' type=<root>.IFoo origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.DFoo declared in <root>.DFoo.<get-testExtVal>' type=<root>.DFoo origin=null
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.DFoo.<get-testExtVal>' type=kotlin.String origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]
EXPRESSION_BODY
GET_VAR 'd: <root>.IFoo declared in <root>.DFoo.<init>' type=<root>.IFoo origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
@@ -32,26 +32,26 @@ class DFoo : IFoo {
@Ann
override fun testFun() {
<this>.#<$$delegate_0>.testFun()
<this>.#$$delegate_0.testFun()
}
@Ann
override fun String.testExtFun() {
(<this>.#<$$delegate_0>, <this>).testExtFun()
(<this>.#$$delegate_0, <this>).testExtFun()
}
@Ann
override val testVal: String
override get(): String {
return <this>.#<$$delegate_0>.<get-testVal>()
return <this>.#$$delegate_0.<get-testVal>()
}
@Ann
override val String.testExtVal: String
override get(): String {
return (<this>.#<$$delegate_0>, <this>).<get-testExtVal>()
return (<this>.#$$delegate_0, <this>).<get-testExtVal>()
}
local /* final field */ val <$$delegate_0>: IFoo = d
private /* final field */ val $$delegate_0: IFoo = d
}
@@ -53,7 +53,7 @@ FILE fqName:<root> fileName:/inheritingDeprecation.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-prop> (): kotlin.String declared in <root>.Delegated'
CALL 'public open fun <get-prop> (): kotlin.String declared in <root>.IFoo' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]' type=<root>.IFoo origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.Delegated declared in <root>.Delegated.<get-prop>' type=<root>.Delegated origin=null
PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val]
annotations:
@@ -69,10 +69,10 @@ FILE fqName:<root> fileName:/inheritingDeprecation.kt
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-extProp> (): kotlin.String declared in <root>.Delegated'
CALL 'public open fun <get-extProp> (): kotlin.String declared in <root>.IFoo' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]' type=<root>.IFoo origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]' type=<root>.IFoo origin=null
receiver: GET_VAR '<this>: <root>.Delegated declared in <root>.Delegated.<get-extProp>' type=<root>.Delegated origin=null
$receiver: GET_VAR '<this>: kotlin.String declared in <root>.Delegated.<get-extProp>' type=kotlin.String origin=null
FIELD DELEGATE name:<$$delegate_0> type:<root>.IFoo visibility:local [final]
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:private [final]
EXPRESSION_BODY
GET_VAR 'foo: <root>.IFoo declared in <root>.Delegated.<init>' type=<root>.IFoo origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
@@ -23,16 +23,16 @@ class Delegated : IFoo {
@Deprecated(message = "")
override val prop: String
override get(): String {
return <this>.#<$$delegate_0>.<get-prop>()
return <this>.#$$delegate_0.<get-prop>()
}
@Deprecated(message = "")
override val String.extProp: String
override get(): String {
return (<this>.#<$$delegate_0>, <this>).<get-extProp>()
return (<this>.#$$delegate_0, <this>).<get-extProp>()
}
local /* final field */ val <$$delegate_0>: IFoo = foo
private /* final field */ val $$delegate_0: IFoo = foo
}