FIR2IR: don't create separate delegate fields for constructor properties
This commit is contained in:
+33
-11
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.backend
|
||||
|
||||
import org.jetbrains.kotlin.KtFakeSourceElementKind
|
||||
import org.jetbrains.kotlin.KtNodeTypes
|
||||
import org.jetbrains.kotlin.builtins.StandardNames.BUILT_INS_PACKAGE_FQ_NAMES
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||
@@ -20,10 +21,7 @@ import org.jetbrains.kotlin.fir.declarations.utils.*
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirBuiltInsPackageFragment
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor
|
||||
import org.jetbrains.kotlin.fir.descriptors.FirPackageFragmentDescriptor
|
||||
import org.jetbrains.kotlin.fir.expressions.FirComponentCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirConstExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccess
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.expressions.impl.FirExpressionStub
|
||||
import org.jetbrains.kotlin.fir.lazy.Fir2IrLazyClass
|
||||
import org.jetbrains.kotlin.fir.lazy.Fir2IrLazyConstructor
|
||||
@@ -945,17 +943,41 @@ class Fir2IrDeclarationStorage(
|
||||
|
||||
fun getCachedIrField(field: FirField): IrField? = fieldCache[field]
|
||||
|
||||
fun createIrFieldAndDelegatedMembers(field: FirField, owner: FirClass, irClass: IrClass): IrField {
|
||||
val irField = createIrField(
|
||||
field,
|
||||
typeRef = field.initializer?.typeRef ?: field.returnTypeRef,
|
||||
origin = IrDeclarationOrigin.DELEGATE
|
||||
)
|
||||
irField.setAndModifyParent(irClass)
|
||||
fun createIrFieldAndDelegatedMembers(field: FirField, owner: FirClass, irClass: IrClass): IrField? {
|
||||
// Either take a corresponding constructor property backing field,
|
||||
// or create a separate delegate field
|
||||
val irField = getOrCreateDelegateIrField(field, owner, irClass)
|
||||
delegatedMemberGenerator.generate(irField, field, owner, irClass)
|
||||
if (owner.isLocalClassOrAnonymousObject()) {
|
||||
delegatedMemberGenerator.generateBodies()
|
||||
}
|
||||
// If it's a property backing field, it should not be added to the class in Fir2IrConverter, so it's not returned
|
||||
return irField.takeIf { it.correspondingPropertySymbol == null }
|
||||
}
|
||||
|
||||
private fun getOrCreateDelegateIrField(field: FirField, owner: FirClass, irClass: IrClass): IrField {
|
||||
val initializer = field.initializer
|
||||
if (initializer is FirQualifiedAccessExpression && initializer.explicitReceiver == null) {
|
||||
val resolvedSymbol = initializer.calleeReference.resolvedSymbol as? FirValueParameterSymbol
|
||||
if (resolvedSymbol is FirValueParameterSymbol) {
|
||||
val name = resolvedSymbol.name
|
||||
val constructorProperty = owner.declarations.filterIsInstance<FirProperty>().find {
|
||||
it.name == name && it.source?.kind is KtFakeSourceElementKind.PropertyFromParameter
|
||||
}
|
||||
if (constructorProperty != null) {
|
||||
val irProperty = getOrCreateIrProperty(constructorProperty, irClass)
|
||||
val backingField = irProperty.backingField!!
|
||||
fieldCache[field] = backingField
|
||||
return backingField
|
||||
}
|
||||
}
|
||||
}
|
||||
val irField = createIrField(
|
||||
field,
|
||||
typeRef = initializer?.typeRef ?: field.returnTypeRef,
|
||||
origin = IrDeclarationOrigin.DELEGATE
|
||||
)
|
||||
irField.setAndModifyParent(irClass)
|
||||
return irField
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,11 @@ class Fir2IrVisitor(
|
||||
override fun visitField(field: FirField, data: Any?): IrField {
|
||||
if (field.isSynthetic) {
|
||||
return declarationStorage.getCachedIrField(field)!!.apply {
|
||||
memberGenerator.convertFieldContent(this, field)
|
||||
// If this is a property backing field, then it has no separate initializer,
|
||||
// so we shouldn't convert it
|
||||
if (correspondingPropertySymbol == null) {
|
||||
memberGenerator.convertFieldContent(this, field)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw AssertionError("Unexpected field: ${field.render()}")
|
||||
|
||||
+4
-7
@@ -142,7 +142,7 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun foo <B> (a: A of <root>.IBase, b: B of <root>.IBase.foo): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
|
||||
<B>: B of <root>.Test2.foo
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.IBase<kotlin.String> visibility:private' type=<root>.IBase<kotlin.String> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.foo' type=<root>.Test2 origin=null
|
||||
a: GET_VAR 'a: kotlin.String declared in <root>.Test2.foo' type=kotlin.String origin=null
|
||||
b: GET_VAR 'b: B of <root>.Test2.foo declared in <root>.Test2.foo' type=B of <root>.Test2.foo origin=null
|
||||
@@ -160,7 +160,7 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-id> <C> (): kotlin.collections.Map<kotlin.String, C of <root>.Test2.<get-id>>? declared in <root>.Test2'
|
||||
CALL 'public abstract fun <get-id> <C> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>? declared in <root>.IBase' type=kotlin.collections.Map<kotlin.String, C of <root>.Test2.<get-id>>? origin=null
|
||||
<C>: C of <root>.Test2.<get-id>
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.IBase<kotlin.String> visibility:private' type=<root>.IBase<kotlin.String> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-id>' type=<root>.Test2 origin=null
|
||||
$receiver: GET_VAR '<this>: C of <root>.Test2.<get-id> declared in <root>.Test2.<get-id>' type=C of <root>.Test2.<get-id> origin=null
|
||||
PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
|
||||
@@ -177,7 +177,7 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-x> <D> (): D of <root>.Test2.<get-x>? declared in <root>.Test2'
|
||||
CALL 'public abstract fun <get-x> <D> (): D of <root>.IBase.<get-x>? declared in <root>.IBase' type=D of <root>.Test2.<get-x>? origin=null
|
||||
<D>: D of <root>.Test2.<get-x>
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.IBase<kotlin.String> visibility:private' type=<root>.IBase<kotlin.String> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-x>' type=<root>.Test2 origin=null
|
||||
$receiver: GET_VAR '<this>: kotlin.collections.List<D of <root>.Test2.<get-x>> declared in <root>.Test2.<get-x>' type=kotlin.collections.List<D of <root>.Test2.<get-x>> origin=null
|
||||
FUN DELEGATED_MEMBER name:<set-x> visibility:public modality:OPEN <D> ($this:<root>.Test2, $receiver:kotlin.collections.List<D of <root>.Test2.<get-x>>, <set-?>:D of <root>.Test2.<set-x>?) returnType:kotlin.Unit
|
||||
@@ -191,13 +191,10 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun <set-x> <D> (<set-?>: D of <root>.IBase.<set-x>?): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
|
||||
<D>: D of <root>.Test2.<set-x>
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.IBase<kotlin.String> visibility:private' type=<root>.IBase<kotlin.String> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<set-x>' type=<root>.Test2 origin=null
|
||||
$receiver: GET_VAR '<this>: kotlin.collections.List<D of <root>.Test2.<get-x>> declared in <root>.Test2.<set-x>' type=kotlin.collections.List<D of <root>.Test2.<get-x>> origin=null
|
||||
<set-?>: GET_VAR '<set-?>: D of <root>.Test2.<set-x>? declared in <root>.Test2.<set-x>' type=D of <root>.Test2.<set-x>? origin=null
|
||||
FIELD DELEGATE name:<$$delegate_0> type:<root>.IBase<kotlin.String> visibility:local [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'j: <root>.IBase<kotlin.String> declared in <root>.Test2.<init>' type=<root>.IBase<kotlin.String> origin=null
|
||||
PROPERTY name:j visibility:public modality:FINAL [var]
|
||||
FIELD PROPERTY_BACKING_FIELD name:j type:<root>.IBase<kotlin.String> visibility:private
|
||||
EXPRESSION_BODY
|
||||
|
||||
+4
-5
@@ -45,23 +45,22 @@ class Test2 : IBase<String> {
|
||||
}
|
||||
|
||||
override fun <B : Any?> foo(a: String, b: B) {
|
||||
<this>.#<$$delegate_0>.foo<B>(a = a, b = b)
|
||||
<this>.#j.foo<B>(a = a, b = b)
|
||||
}
|
||||
|
||||
override val <C : Any?> C.id: Map<String, C>?
|
||||
override get(): Map<String, C>? {
|
||||
return (<this>.#<$$delegate_0>, <this>).<get-id><C>()
|
||||
return (<this>.#j, <this>).<get-id><C>()
|
||||
}
|
||||
|
||||
override var <D : Any?> List<D>.x: D?
|
||||
override get(): D? {
|
||||
return (<this>.#<$$delegate_0>, <this>).<get-x><D>()
|
||||
return (<this>.#j, <this>).<get-x><D>()
|
||||
}
|
||||
override set(<set-?>: D?) {
|
||||
(<this>.#<$$delegate_0>, <this>).<set-x><D>(<set-?> = <set-?>)
|
||||
(<this>.#j, <this>).<set-x><D>(<set-?> = <set-?>)
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: IBase<String> = j
|
||||
var j: IBase<String>
|
||||
field = j
|
||||
get
|
||||
|
||||
+6
-9
@@ -13,7 +13,7 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
|
||||
VALUE_PARAMETER name:x index:0 type:@[EnhancedNullability] kotlin.String
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun takeNotNull (x: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.takeNotNull' type=<root>.Test origin=null
|
||||
x: GET_VAR 'x: @[EnhancedNullability] kotlin.String declared in <root>.Test.takeNotNull' type=@[EnhancedNullability] kotlin.String origin=null
|
||||
FUN DELEGATED_MEMBER name:takeNullable visibility:public modality:OPEN <> ($this:<root>.Test, x:kotlin.String?) returnType:kotlin.Unit
|
||||
@@ -23,7 +23,7 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
|
||||
VALUE_PARAMETER name:x index:0 type:kotlin.String?
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.takeNullable' type=<root>.Test origin=null
|
||||
x: GET_VAR 'x: kotlin.String? declared in <root>.Test.takeNullable' type=kotlin.String? origin=null
|
||||
FUN DELEGATED_MEMBER name:takeFlexible visibility:public modality:OPEN <> ($this:<root>.Test, x:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Unit
|
||||
@@ -33,7 +33,7 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
|
||||
VALUE_PARAMETER name:x index:0 type:@[FlexibleNullability] kotlin.String?
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun takeFlexible (x: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in <root>.J' type=kotlin.Unit origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.takeFlexible' type=<root>.Test origin=null
|
||||
x: GET_VAR 'x: @[FlexibleNullability] kotlin.String? declared in <root>.Test.takeFlexible' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
FUN DELEGATED_MEMBER name:returnNotNull visibility:public modality:OPEN <> ($this:<root>.Test) returnType:@[EnhancedNullability] kotlin.String
|
||||
@@ -46,7 +46,7 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
|
||||
RETURN type=kotlin.Nothing from='public open fun returnNotNull (): @[EnhancedNullability] kotlin.String declared in <root>.Test'
|
||||
TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String
|
||||
CALL 'public abstract fun returnNotNull (): @[EnhancedNullability] kotlin.String declared in <root>.J' type=@[EnhancedNullability] kotlin.String origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.returnNotNull' type=<root>.Test origin=null
|
||||
FUN DELEGATED_MEMBER name:returnNullable visibility:public modality:OPEN <> ($this:<root>.Test) returnType:kotlin.String?
|
||||
annotations:
|
||||
@@ -57,7 +57,7 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun returnNullable (): kotlin.String? declared in <root>.Test'
|
||||
CALL 'public abstract fun returnNullable (): kotlin.String? declared in <root>.J' type=kotlin.String? origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.returnNullable' type=<root>.Test origin=null
|
||||
FUN DELEGATED_MEMBER name:returnsFlexible visibility:public modality:OPEN <> ($this:<root>.Test) returnType:@[FlexibleNullability] kotlin.String?
|
||||
overridden:
|
||||
@@ -66,11 +66,8 @@ FILE fqName:<root> fileName:/delegatedImplementationOfJavaInterface.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun returnsFlexible (): @[FlexibleNullability] kotlin.String? declared in <root>.Test'
|
||||
CALL 'public abstract fun returnsFlexible (): @[FlexibleNullability] kotlin.String? declared in <root>.J' type=@[FlexibleNullability] kotlin.String? origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]' type=<root>.J origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]' type=<root>.J origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Test declared in <root>.Test.returnsFlexible' type=<root>.Test origin=null
|
||||
FIELD DELEGATE name:<$$delegate_0> type:<root>.J visibility:local [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'j: <root>.J declared in <root>.Test.<init>' type=<root>.J origin=null
|
||||
PROPERTY name:j visibility:private modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:j type:<root>.J visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
|
||||
+6
-7
@@ -6,32 +6,31 @@ class Test : J {
|
||||
}
|
||||
|
||||
override fun takeNotNull(x: @EnhancedNullability String) {
|
||||
<this>.#<$$delegate_0>.takeNotNull(x = x)
|
||||
<this>.#j.takeNotNull(x = x)
|
||||
}
|
||||
|
||||
override fun takeNullable(x: String?) {
|
||||
<this>.#<$$delegate_0>.takeNullable(x = x)
|
||||
<this>.#j.takeNullable(x = x)
|
||||
}
|
||||
|
||||
override fun takeFlexible(x: @FlexibleNullability String?) {
|
||||
<this>.#<$$delegate_0>.takeFlexible(x = x)
|
||||
<this>.#j.takeFlexible(x = x)
|
||||
}
|
||||
|
||||
@NotNull
|
||||
override fun returnNotNull(): @EnhancedNullability String {
|
||||
return <this>.#<$$delegate_0>.returnNotNull() /*!! String */
|
||||
return <this>.#j.returnNotNull() /*!! String */
|
||||
}
|
||||
|
||||
@Nullable
|
||||
override fun returnNullable(): String? {
|
||||
return <this>.#<$$delegate_0>.returnNullable()
|
||||
return <this>.#j.returnNullable()
|
||||
}
|
||||
|
||||
override fun returnsFlexible(): @FlexibleNullability String? {
|
||||
return <this>.#<$$delegate_0>.returnsFlexible()
|
||||
return <this>.#j.returnsFlexible()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: J = j
|
||||
private val j: J
|
||||
field = j
|
||||
private get
|
||||
|
||||
@@ -127,7 +127,7 @@ FILE fqName:<root> fileName:/Fir2IrClassifierStorage.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-session> (): <root>.FirSession declared in <root>.Fir2IrClassifierStorage'
|
||||
CALL 'public abstract fun <get-session> (): <root>.FirSession declared in <root>.Fir2IrComponents' type=<root>.FirSession origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.Fir2IrComponents visibility:local [final]' type=<root>.Fir2IrComponents origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:<root>.Fir2IrComponents visibility:private [final]' type=<root>.Fir2IrComponents origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Fir2IrClassifierStorage declared in <root>.Fir2IrClassifierStorage.<get-session>' type=<root>.Fir2IrClassifierStorage origin=null
|
||||
PROPERTY DELEGATED_MEMBER name:classifierStorage visibility:public modality:OPEN [val]
|
||||
overridden:
|
||||
@@ -140,11 +140,8 @@ FILE fqName:<root> fileName:/Fir2IrClassifierStorage.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-classifierStorage> (): <root>.Fir2IrClassifierStorage declared in <root>.Fir2IrClassifierStorage'
|
||||
CALL 'public abstract fun <get-classifierStorage> (): <root>.Fir2IrClassifierStorage declared in <root>.Fir2IrComponents' type=<root>.Fir2IrClassifierStorage origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.Fir2IrComponents visibility:local [final]' type=<root>.Fir2IrComponents origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:<root>.Fir2IrComponents visibility:private [final]' type=<root>.Fir2IrComponents origin=null
|
||||
receiver: GET_VAR '<this>: <root>.Fir2IrClassifierStorage declared in <root>.Fir2IrClassifierStorage.<get-classifierStorage>' type=<root>.Fir2IrClassifierStorage origin=null
|
||||
FIELD DELEGATE name:<$$delegate_0> type:<root>.Fir2IrComponents visibility:local [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'components: <root>.Fir2IrComponents declared in <root>.Fir2IrClassifierStorage.<init>' type=<root>.Fir2IrComponents origin=null
|
||||
PROPERTY name:components visibility:private modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:components type:<root>.Fir2IrComponents visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -46,15 +46,14 @@ class Fir2IrClassifierStorage : Fir2IrComponents {
|
||||
|
||||
override val session: FirSession
|
||||
override get(): FirSession {
|
||||
return <this>.#<$$delegate_0>.<get-session>()
|
||||
return <this>.#components.<get-session>()
|
||||
}
|
||||
|
||||
override val classifierStorage: Fir2IrClassifierStorage
|
||||
override get(): Fir2IrClassifierStorage {
|
||||
return <this>.#<$$delegate_0>.<get-classifierStorage>()
|
||||
return <this>.#components.<get-classifierStorage>()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: Fir2IrComponents = components
|
||||
private val components: Fir2IrComponents
|
||||
field = components
|
||||
private get
|
||||
|
||||
@@ -96,11 +96,8 @@ FILE fqName:<root> fileName:/SignatureClash.kt
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.DataClass
|
||||
BLOCK_BODY
|
||||
CALL 'public abstract fun bar (): kotlin.Unit declared in <root>.Delegate' type=kotlin.Unit origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:<root>.Delegate visibility:local [final]' type=<root>.Delegate origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:<root>.Delegate visibility:private [final]' type=<root>.Delegate origin=null
|
||||
receiver: GET_VAR '<this>: <root>.DataClass declared in <root>.DataClass.bar' type=<root>.DataClass origin=null
|
||||
FIELD DELEGATE name:<$$delegate_0> type:<root>.Delegate visibility:local [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'delegate: <root>.Delegate declared in <root>.DataClass.<init>' type=<root>.Delegate origin=null
|
||||
PROPERTY name:delegate visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:delegate type:<root>.Delegate visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -37,10 +37,9 @@ data class DataClass : Derived, Delegate {
|
||||
}
|
||||
|
||||
override fun bar() {
|
||||
<this>.#<$$delegate_0>.bar()
|
||||
<this>.#delegate.bar()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: Delegate = delegate
|
||||
val delegate: Delegate
|
||||
field = delegate
|
||||
get
|
||||
|
||||
+8
-11
@@ -16,7 +16,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun containsKey (key: K of <root>.ControlFlowInfo): kotlin.Boolean declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun containsKey (key: K of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.containsKey' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
key: GET_VAR 'key: K of <root>.ControlFlowInfo declared in <root>.ControlFlowInfo.containsKey' type=K of <root>.ControlFlowInfo origin=null
|
||||
FUN DELEGATED_MEMBER name:containsValue visibility:public modality:OPEN <> ($this:<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>, value:V of <root>.ControlFlowInfo) returnType:kotlin.Boolean
|
||||
@@ -27,7 +27,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun containsValue (value: V of <root>.ControlFlowInfo): kotlin.Boolean declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun containsValue (value: V of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.containsValue' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
value: GET_VAR 'value: V of <root>.ControlFlowInfo declared in <root>.ControlFlowInfo.containsValue' type=V of <root>.ControlFlowInfo origin=null
|
||||
FUN DELEGATED_MEMBER name:get visibility:public modality:OPEN <> ($this:<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>, key:K of <root>.ControlFlowInfo) returnType:V of <root>.ControlFlowInfo? [operator]
|
||||
@@ -38,7 +38,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun get (key: K of <root>.ControlFlowInfo): V of <root>.ControlFlowInfo? [operator] declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? [operator] declared in kotlin.collections.Map' type=V of <root>.ControlFlowInfo? origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.get' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
key: GET_VAR 'key: K of <root>.ControlFlowInfo declared in <root>.ControlFlowInfo.get' type=K of <root>.ControlFlowInfo origin=null
|
||||
FUN DELEGATED_MEMBER name:isEmpty visibility:public modality:OPEN <> ($this:<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>) returnType:kotlin.Boolean
|
||||
@@ -48,7 +48,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.isEmpty' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
PROPERTY DELEGATED_MEMBER name:entries visibility:public modality:OPEN [val]
|
||||
overridden:
|
||||
@@ -61,7 +61,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-entries> (): kotlin.collections.Set<kotlin.collections.Map.Entry<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>> declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun <get-entries> (): kotlin.collections.Set<kotlin.collections.Map.Entry<K of kotlin.collections.Map, V of kotlin.collections.Map>> declared in kotlin.collections.Map' type=kotlin.collections.Set<kotlin.collections.Map.Entry<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo>> origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.<get-entries>' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val]
|
||||
overridden:
|
||||
@@ -74,7 +74,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-keys> (): kotlin.collections.Set<K of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun <get-keys> (): kotlin.collections.Set<K of kotlin.collections.Map> declared in kotlin.collections.Map' type=kotlin.collections.Set<K of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.<get-keys>' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val]
|
||||
overridden:
|
||||
@@ -87,7 +87,7 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-size> (): kotlin.Int declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun <get-size> (): kotlin.Int declared in kotlin.collections.Map' type=kotlin.Int origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.<get-size>' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
PROPERTY DELEGATED_MEMBER name:values visibility:public modality:OPEN [val]
|
||||
overridden:
|
||||
@@ -100,11 +100,8 @@ FILE fqName:<root> fileName:/kt43342.kt
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun <get-values> (): kotlin.collections.Collection<V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo'
|
||||
CALL 'public abstract fun <get-values> (): kotlin.collections.Collection<V of kotlin.collections.Map> declared in kotlin.collections.Map' type=kotlin.collections.Collection<V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
$this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
receiver: GET_VAR '<this>: <root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.<get-values>' type=<root>.ControlFlowInfo<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
FIELD DELEGATE name:<$$delegate_0> type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:local [final]
|
||||
EXPRESSION_BODY
|
||||
GET_VAR 'map: kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> declared in <root>.ControlFlowInfo.<init>' type=kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> origin=null
|
||||
PROPERTY name:map visibility:public modality:FINAL [val]
|
||||
FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map<K of <root>.ControlFlowInfo, V of <root>.ControlFlowInfo> visibility:private [final]
|
||||
EXPRESSION_BODY
|
||||
|
||||
@@ -6,42 +6,41 @@ open class ControlFlowInfo<K : Any?, V : Any?> : Map<K, V> {
|
||||
}
|
||||
|
||||
override fun containsKey(key: K): Boolean {
|
||||
return <this>.#<$$delegate_0>.containsKey(key = key)
|
||||
return <this>.#map.containsKey(key = key)
|
||||
}
|
||||
|
||||
override fun containsValue(value: V): Boolean {
|
||||
return <this>.#<$$delegate_0>.containsValue(value = value)
|
||||
return <this>.#map.containsValue(value = value)
|
||||
}
|
||||
|
||||
override operator fun get(key: K): V? {
|
||||
return <this>.#<$$delegate_0>.get(key = key)
|
||||
return <this>.#map.get(key = key)
|
||||
}
|
||||
|
||||
override fun isEmpty(): Boolean {
|
||||
return <this>.#<$$delegate_0>.isEmpty()
|
||||
return <this>.#map.isEmpty()
|
||||
}
|
||||
|
||||
override val entries: Set<Entry<K, V>>
|
||||
override get(): Set<Entry<K, V>> {
|
||||
return <this>.#<$$delegate_0>.<get-entries>()
|
||||
return <this>.#map.<get-entries>()
|
||||
}
|
||||
|
||||
override val keys: Set<K>
|
||||
override get(): Set<K> {
|
||||
return <this>.#<$$delegate_0>.<get-keys>()
|
||||
return <this>.#map.<get-keys>()
|
||||
}
|
||||
|
||||
override val size: Int
|
||||
override get(): Int {
|
||||
return <this>.#<$$delegate_0>.<get-size>()
|
||||
return <this>.#map.<get-size>()
|
||||
}
|
||||
|
||||
override val values: Collection<V>
|
||||
override get(): Collection<V> {
|
||||
return <this>.#<$$delegate_0>.<get-values>()
|
||||
return <this>.#map.<get-values>()
|
||||
}
|
||||
|
||||
local /* final field */ val <$$delegate_0>: Map<K, V> = map
|
||||
val map: Map<K, V>
|
||||
field = map
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user