[FIR] add support for implementation by delgation

This commit handles "subclass: super-interface by delegate-expression".

During Psi2Fir, for each delegate, we add to the subclass a synthetic
field (which has type super-interface), and an assignment of the
delegate-expression to the synthetic field in the primary constructor,
so that the delegate-expression can be resolved and transformed along
the way.

During Fir2Ir, we look up delegatable members from the super-interface
and generate corresponding functions/properties for the subclass.

TODO: support for generic delegatable members and generic
super-interface.
This commit is contained in:
Juan Chen
2020-06-08 21:00:49 -07:00
committed by Mikhail Glukhikh
parent 1d45dc8d81
commit d163853c97
52 changed files with 806 additions and 187 deletions
@@ -13,8 +13,11 @@ FILE: delegatedSuperType.kt
}
public final class C : R|A| {
local final field $$delegate_0: R|A|
public constructor(b: R|B|): R|C| {
super<R|kotlin/Any|>()
this@R|/C|.R|<local>/$$delegate_0| = R|<local>/b|
}
public final val b: R|B| = R|<local>/b|
@@ -407,6 +407,10 @@ fun isOverriding(
// Not checking the field type (they should match each other if everything other match, otherwise it's a compilation error)
target.name == superCandidate.name
}
target is IrProperty && superCandidate is IrProperty -> {
// Not checking the property type (they should match each other if names match, otherwise it's a compilation error)
target.name == superCandidate.name
}
else -> false
}
}
@@ -5,7 +5,10 @@
package org.jetbrains.kotlin.fir.backend
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.lazy.Fir2IrLazyClass
import org.jetbrains.kotlin.fir.resolve.firProvider
@@ -23,7 +26,10 @@ import org.jetbrains.kotlin.ir.declarations.impl.IrClassImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrEnumEntryImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrTypeAliasImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrTypeParameterImpl
import org.jetbrains.kotlin.ir.descriptors.*
import org.jetbrains.kotlin.ir.descriptors.WrappedClassDescriptor
import org.jetbrains.kotlin.ir.descriptors.WrappedEnumEntryDescriptor
import org.jetbrains.kotlin.ir.descriptors.WrappedTypeAliasDescriptor
import org.jetbrains.kotlin.ir.descriptors.WrappedTypeParameterDescriptor
import org.jetbrains.kotlin.ir.expressions.impl.IrEnumConstructorCallImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
@@ -87,7 +87,7 @@ class Fir2IrConverter(
anonymousObject.getPrimaryConstructorIfAny()?.let {
irClass.declarations += declarationStorage.createIrConstructor(it, irClass)
}
for (declaration in anonymousObject.declarations) {
for (declaration in sortBySynthetic(anonymousObject.declarations)) {
if (declaration is FirRegularClass) {
registerClassAndNestedClasses(declaration, irClass)
processClassAndNestedClassHeaders(declaration)
@@ -98,6 +98,13 @@ class Fir2IrConverter(
return irClass
}
// Sort declarations so that all non-synthetic declarations are before synthetic ones.
// This is needed because converting synthetic fields for implementation delegation needs to know
// existing declarations in the class to avoid adding redundant delegated members.
private fun sortBySynthetic(declarations: List<FirDeclaration>) : Iterable<FirDeclaration> {
return declarations.sortedBy { it.isSynthetic }
}
private fun processClassMembers(
regularClass: FirRegularClass,
irClass: IrClass = classifierStorage.getCachedIrClass(regularClass)!!
@@ -105,7 +112,7 @@ class Fir2IrConverter(
regularClass.getPrimaryConstructorIfAny()?.let {
irClass.declarations += declarationStorage.createIrConstructor(it, irClass)
}
for (declaration in regularClass.declarations) {
for (declaration in sortBySynthetic(regularClass.declarations)) {
val irDeclaration = processMemberDeclaration(declaration, irClass) ?: continue
irClass.declarations += irDeclaration
}
@@ -142,6 +149,13 @@ class Fir2IrConverter(
is FirProperty -> {
declarationStorage.createIrProperty(declaration, parent)
}
is FirField -> {
if (declaration.isSynthetic) {
declarationStorage.createIrFieldAndDelegatedMembers(declaration, parent as IrClass)
} else {
throw AssertionError("Unexpected non-synthetic field: ${declaration::class}")
}
}
is FirConstructor -> if (!declaration.isPrimary) {
declarationStorage.createIrConstructor(declaration, parent as IrClass)
} else {
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.fir.FirAnnotationContainer
import org.jetbrains.kotlin.fir.backend.generators.AnnotationGenerator
import org.jetbrains.kotlin.fir.backend.generators.DelegatedMemberGenerator
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertySetter
@@ -36,12 +37,9 @@ import org.jetbrains.kotlin.ir.declarations.impl.*
import org.jetbrains.kotlin.ir.descriptors.*
import org.jetbrains.kotlin.ir.expressions.IrExpression
import org.jetbrains.kotlin.ir.expressions.IrSyntheticBodyKind
import org.jetbrains.kotlin.ir.expressions.impl.IrErrorExpressionImpl
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.symbols.*
import org.jetbrains.kotlin.ir.types.IrErrorType
import org.jetbrains.kotlin.ir.types.IrSimpleType
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.*
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.FqName
@@ -78,6 +76,8 @@ class Fir2IrDeclarationStorage(
private val localStorage = Fir2IrLocalStorage()
private val delegatedMemberGenerator = DelegatedMemberGenerator(components)
private fun areCompatible(firFunction: FirFunction<*>, irFunction: IrFunction): Boolean {
if (firFunction is FirSimpleFunction && irFunction is IrSimpleFunction) {
if (irFunction.name != firFunction.name) return false
@@ -700,9 +700,39 @@ class Fir2IrDeclarationStorage(
fun getCachedIrProperty(property: FirProperty): IrProperty? = propertyCache[property]
private fun createIrField(field: FirField): IrField {
fun getCachedIrField(field: FirField): IrField? = fieldCache[field]
fun createIrFieldAndDelegatedMembers(field: FirField, parent: IrClass): IrField {
val irField = createIrField(field, origin = IrDeclarationOrigin.DELEGATE)
irField.setAndModifyParent(parent)
delegatedMemberGenerator.generate(irField, parent)
return irField
}
internal fun findOverriddenFirFunction(irFunction: IrSimpleFunction, superClassId: ClassId): FirFunction<*>? {
val functions = getFirClassByFqName(superClassId)?.declarations?.filter {
it is FirFunction<*> && functionCache.containsKey(it) && irFunction.overrides(functionCache[it]!!)
}
return if (functions.isNullOrEmpty()) null else functions.first() as FirFunction<*>
}
internal fun findOverriddenFirProperty(irProperty: IrProperty, superClassId: ClassId): FirProperty? {
val properties = getFirClassByFqName(superClassId)?.declarations?.filter {
it is FirProperty && it.name == irProperty.name
}
return if (properties.isNullOrEmpty()) null else properties.first() as FirProperty
}
private fun getFirClassByFqName(classId: ClassId): FirClass<*>? {
val declaration = firProvider.getClassLikeSymbolByFqName(classId) ?: firSymbolProvider.getClassLikeSymbolByFqName(classId)
return declaration?.fir as? FirClass<*>
}
private fun createIrField(
field: FirField,
origin: IrDeclarationOrigin = IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
): IrField {
val descriptor = WrappedFieldDescriptor()
val origin = IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
val type = field.returnTypeRef.toIrType()
return field.convertWithOffsets { startOffset, endOffset ->
symbolTable.declareField(
@@ -76,6 +76,14 @@ class Fir2IrVisitor(
TODO("Should not be here: ${element.render()}")
}
override fun visitField(field: FirField, data: Any?): IrField {
if (field.isSynthetic) {
return declarationStorage.getCachedIrField(field)!!
} else {
throw AssertionError("Unexpected field: ${field.render()}")
}
}
override fun visitFile(file: FirFile, data: Any?): IrFile {
return conversionScope.withParent(declarationStorage.getIrFile(file)) {
file.declarations.forEach {
@@ -59,6 +59,16 @@ internal class ClassMemberGenerator(
else -> null
}
}
// Add delegated members *before* fake override generations.
// Otherwise, fake overrides for delegated members, which are redundant, will be added.
irClass.declarations.filter {
it.origin == IrDeclarationOrigin.DELEGATED_MEMBER
}.forEach {
when (it) {
is IrSimpleFunction -> processedCallableNames += it.name
is IrProperty -> processedCallableNames += it.name
}
}
// Add synthetic members *before* fake override generations.
// Otherwise, redundant members, e.g., synthetic toString _and_ fake override toString, will be added.
if (irClass.isInline && klass.getPrimaryConstructorIfAny() != null) {
@@ -0,0 +1,271 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.fir.backend.generators
import org.jetbrains.kotlin.backend.common.ir.isFinalClass
import org.jetbrains.kotlin.backend.common.ir.isOverridable
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.fir.backend.Fir2IrComponents
import org.jetbrains.kotlin.fir.backend.FirMetadataSource
import org.jetbrains.kotlin.fir.backend.declareThisReceiverParameter
import org.jetbrains.kotlin.fir.backend.isOverriding
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.builder.buildProperty
import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunction
import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameterCopy
import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl
import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl
import org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl
import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyDescriptor
import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor
import org.jetbrains.kotlin.ir.descriptors.WrappedValueParameterDescriptor
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.types.classOrNull
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
import org.jetbrains.kotlin.ir.types.isNothing
import org.jetbrains.kotlin.ir.types.isUnit
import org.jetbrains.kotlin.ir.util.classId
import org.jetbrains.kotlin.ir.util.defaultType
import org.jetbrains.kotlin.ir.util.hasAnnotation
import org.jetbrains.kotlin.ir.util.isFakeOverride
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
/**
* A generator for delegated members from implementation by delegation.
*
* It assumes a synthetic field with the super-interface type has been created for the delegate expression. It looks for delegatable
* methods and properties in the super-interface, and creates corresponding members in the subclass.
* TODO: generic super interface types and generic delegated members.
*/
internal class DelegatedMemberGenerator(
private val components: Fir2IrComponents
) : Fir2IrComponents by components {
// Generate delegated members for [subClass]. The synthetic field [irField] has the super interface type.
fun generate(irField: IrField, subClass: IrClass) {
val superClass = (irField.type as IrSimpleTypeImpl)?.classOrNull?.owner ?: return
val superClassId = superClass.classId ?: return
superClass.declarations?.filter {
it.isDelegatable() && !subClass.declarations.any { decl -> isOverriding(irBuiltIns, decl, it) }
}?.forEach {
if (it is IrSimpleFunction) {
val firFunction = declarationStorage.findOverriddenFirFunction(it, superClassId) ?: return
val function = generateDelegatedFunction(subClass, irField, it, firFunction)
subClass.addMember(function)
} else if (it is IrProperty) {
val firProperty = declarationStorage.findOverriddenFirProperty(it, superClassId) ?: return
generateDelegatedProperty(subClass, irField, it, firProperty)
}
}
}
private fun IrDeclaration.isDelegatable(): Boolean {
return isOverridable()
&& !isFakeOverride
&& !(this is IrSimpleFunction && hasDefaultImplementation())
}
private fun IrDeclaration.isOverridable(): Boolean {
return when (this) {
is IrSimpleFunction -> this.isOverridable
is IrProperty -> visibility != Visibilities.PRIVATE && modality != Modality.FINAL && (parent as? IrClass)?.isFinalClass != true
else -> false
}
}
private fun IrSimpleFunction.hasDefaultImplementation(): Boolean {
var realFunction: IrSimpleFunction? = this
while (realFunction != null && realFunction.isFakeOverride) {
realFunction = realFunction.overriddenSymbols?.firstOrNull()?.owner
}
return realFunction != null
&& (realFunction.modality != Modality.ABSTRACT && realFunction.origin == IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
|| realFunction.annotations.hasAnnotation(FqName("kotlin.jvm.JvmDefault")))
}
private fun generateDelegatedFunction(
subClass: IrClass,
irField: IrField,
superFunction: IrSimpleFunction,
firSuperFunction: FirFunction<*>
): IrSimpleFunction {
val startOffset = irField.startOffset
val endOffset = irField.endOffset
val descriptor = WrappedSimpleFunctionDescriptor()
val origin = IrDeclarationOrigin.DELEGATED_MEMBER
val modality = if (superFunction.modality == Modality.ABSTRACT) Modality.OPEN else superFunction.modality
val delegateFunction = symbolTable.declareSimpleFunction(descriptor) { symbol ->
IrFunctionImpl(
startOffset,
endOffset,
origin,
symbol,
superFunction.name,
superFunction.visibility,
modality,
superFunction.returnType,
superFunction.isInline,
superFunction.isExternal,
superFunction.isTailrec,
superFunction.isSuspend,
superFunction.isOperator,
superFunction.isExpect
).apply {
descriptor.bind(this)
declarationStorage.enterScope(this)
this.parent = subClass
overriddenSymbols += superFunction.symbol
dispatchReceiverParameter = declareThisReceiverParameter(symbolTable, subClass.defaultType, origin)
// TODO: type parameters from superFunctions and type substitution when super interface types are generic
superFunction.valueParameters.forEach { valueParameter ->
val parameterDescriptor = WrappedValueParameterDescriptor()
valueParameters += symbolTable.declareValueParameter(
startOffset, endOffset, origin, parameterDescriptor, valueParameter.type
) { symbol ->
IrValueParameterImpl(
startOffset, endOffset, origin, symbol,
valueParameter.name, valueParameter.index, valueParameter.type,
null, valueParameter.isCrossinline, valueParameter.isNoinline
).also {
parameterDescriptor.bind(it)
it.parent = this
}
}
}
val visibility = when (firSuperFunction) {
is FirSimpleFunction -> firSuperFunction.status.visibility
is FirPropertyAccessor -> firSuperFunction.status.visibility
else -> Visibilities.PUBLIC
}
metadata = FirMetadataSource.Function(
buildSimpleFunction {
this.origin = FirDeclarationOrigin.Synthetic
this.name = superFunction.name
this.symbol = FirNamedFunctionSymbol(getCallableId(subClass, superFunction.name))
this.status = FirDeclarationStatusImpl(visibility, modality)
this.session = components.session
this.returnTypeRef = firSuperFunction.returnTypeRef
firSuperFunction.valueParameters.map { superParameter ->
this.valueParameters.add(
buildValueParameterCopy(superParameter) {
this.origin = FirDeclarationOrigin.Synthetic
this.session = components.session
this.symbol = FirVariableSymbol(superParameter.name)
}
)
}
}
)
declarationStorage.leaveScope(this)
}
}
val body = IrBlockBodyImpl(startOffset, endOffset)
val irCall = IrCallImpl(
startOffset,
endOffset,
superFunction.returnType,
superFunction.symbol,
superFunction.typeParameters.size,
superFunction.valueParameters.size
).apply {
dispatchReceiver =
IrGetFieldImpl(
startOffset, endOffset,
irField.symbol,
irField.type,
IrGetValueImpl(
startOffset, endOffset,
delegateFunction.dispatchReceiverParameter?.type!!,
delegateFunction.dispatchReceiverParameter?.symbol!!
)
)
extensionReceiver =
delegateFunction.extensionReceiverParameter?.let { extensionReceiver ->
IrGetValueImpl(startOffset, endOffset, extensionReceiver.type, extensionReceiver.symbol)
}
delegateFunction.valueParameters.forEach {
putValueArgument(it.index, IrGetValueImpl(startOffset, endOffset, it.type, it.symbol))
}
}
if (superFunction.returnType.isUnit() || superFunction.returnType.isNothing()) {
body.statements.add(irCall)
} else {
val irReturn = IrReturnImpl(startOffset, endOffset, irBuiltIns.nothingType, delegateFunction.symbol, irCall)
body.statements.add(irReturn)
}
delegateFunction.body = body
return delegateFunction
}
private fun generateDelegatedProperty(
subClass: IrClass,
irField: IrField,
superProperty: IrProperty,
firSuperProperty: FirProperty
) {
val startOffset = irField.startOffset
val endOffset = irField.endOffset
val descriptor = WrappedPropertyDescriptor()
val modality = if (superProperty.modality == Modality.ABSTRACT) Modality.OPEN else superProperty.modality
symbolTable.declareProperty(
startOffset, endOffset,
IrDeclarationOrigin.DELEGATED_MEMBER, descriptor, superProperty.isDelegated
) { symbol ->
IrPropertyImpl(
startOffset, endOffset, IrDeclarationOrigin.DELEGATED_MEMBER, symbol,
superProperty.name, superProperty.visibility,
modality,
isVar = superProperty.isVar,
isConst = superProperty.isConst,
isLateinit = superProperty.isLateinit,
isDelegated = superProperty.isDelegated,
isExternal = false,
isExpect = superProperty.isExpect,
isFakeOverride = false
).apply {
descriptor.bind(this)
this.parent = subClass
getter = generateDelegatedFunction(subClass, irField, superProperty.getter!!, firSuperProperty.getter!!).apply {
this.correspondingPropertySymbol = symbol
}
if (superProperty.isVar) {
setter = generateDelegatedFunction(subClass, irField, superProperty.setter!!, firSuperProperty.setter!!).apply {
this.correspondingPropertySymbol = symbol
}
}
this.metadata = FirMetadataSource.Property(
buildProperty {
this.name = superProperty.name
this.origin = FirDeclarationOrigin.Synthetic
this.session = components.session
this.status = FirDeclarationStatusImpl(firSuperProperty.status.visibility, modality)
this.isLocal = firSuperProperty.isLocal
this.returnTypeRef = firSuperProperty.returnTypeRef
this.symbol = FirPropertySymbol(getCallableId(subClass, superProperty.name))
this.isVar = firSuperProperty.isVar
}
)
subClass.addMember(this)
}
}
}
private fun getCallableId(irClass: IrClass, name: Name): CallableId {
val classId = irClass.classId
return if (classId != null) CallableId(classId, name) else CallableId(name)
}
}
@@ -36,6 +36,7 @@ import org.jetbrains.kotlin.fir.lightTree.fir.modifier.Modifier
import org.jetbrains.kotlin.fir.lightTree.fir.modifier.TypeModifier
import org.jetbrains.kotlin.fir.lightTree.fir.modifier.TypeParameterModifier
import org.jetbrains.kotlin.fir.lightTree.fir.modifier.TypeProjectionModifier
import org.jetbrains.kotlin.fir.references.builder.buildSimpleNamedReference
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.impl.*
@@ -408,6 +409,8 @@ class DeclarationsConverter(
val delegationSpecifiers = superTypeList?.let { convertDelegationSpecifiers(it) }
var delegatedSuperTypeRef: FirTypeRef? = delegationSpecifiers?.delegatedSuperTypeRef
val delegatedConstructorSource: FirLightSourceElement? = delegationSpecifiers?.delegatedConstructorSource
delegationSpecifiers?.delegateFields?.map { declarations += it }
val superTypeCallEntry = delegationSpecifiers?.delegatedConstructorArguments.orEmpty()
val superTypeRefs = mutableListOf<FirTypeRef>()
@@ -449,7 +452,10 @@ class DeclarationsConverter(
superTypeCallEntry = superTypeCallEntry
)
//parse primary constructor
val primaryConstructorWrapper = convertPrimaryConstructor(primaryConstructor, classWrapper, delegatedConstructorSource)
val primaryConstructorWrapper = convertPrimaryConstructor(
primaryConstructor, classWrapper, delegatedConstructorSource,
delegationSpecifiers?.primaryConstructorBody
)
val firPrimaryConstructor = primaryConstructorWrapper?.firConstructor
firPrimaryConstructor?.let { declarations += it }
@@ -503,6 +509,8 @@ class DeclarationsConverter(
var delegatedSuperTypeRef: FirTypeRef? = null
var classBody: LighterASTNode? = null
var delegatedConstructorSource: FirLightSourceElement? = null
var delegateFields: List<FirField>? = null
var primaryConstructorBody: FirBlock? = null
objectLiteral.getChildNodesByType(OBJECT_DECLARATION).first().forEachChildren {
when (it.tokenType) {
MODIFIER_LIST -> modifiers = convertModifierList(it)
@@ -512,6 +520,8 @@ class DeclarationsConverter(
superTypeRefs += it.superTypesRef
superTypeCallEntry += it.delegatedConstructorArguments
delegatedConstructorSource = it.delegatedConstructorSource
delegateFields = it.delegateFields
primaryConstructorBody = it.primaryConstructorBody
}
CLASS_BODY -> classBody = it
}
@@ -537,6 +547,7 @@ class DeclarationsConverter(
this.superTypeRefs += superTypeRefs
typeRef = delegatedSelfType
delegateFields?.map { this.declarations += it }
val classWrapper = ClassWrapper(
SpecialNames.NO_NAME_PROVIDED, modifiers, ClassKind.OBJECT, this,
hasPrimaryConstructor = false,
@@ -547,7 +558,7 @@ class DeclarationsConverter(
superTypeCallEntry = superTypeCallEntry
)
//parse primary constructor
convertPrimaryConstructor(primaryConstructor, classWrapper, delegatedConstructorSource)
convertPrimaryConstructor(primaryConstructor, classWrapper, delegatedConstructorSource, primaryConstructorBody)
?.let { this.declarations += it.firConstructor }
//parse declarations
@@ -666,7 +677,8 @@ class DeclarationsConverter(
private fun convertPrimaryConstructor(
primaryConstructor: LighterASTNode?,
classWrapper: ClassWrapper,
delegatedConstructorSource: FirLightSourceElement?
delegatedConstructorSource: FirLightSourceElement?,
body: FirBlock? = null
): PrimaryConstructor? {
if (primaryConstructor == null && !classWrapper.isEnumEntry() && classWrapper.hasSecondaryConstructor) return null
if (classWrapper.isInterface()) return null
@@ -709,6 +721,7 @@ class DeclarationsConverter(
typeParameters += constructorTypeParametersFromConstructedClass(classWrapper.classBuilder.typeParameters)
this.valueParameters += valueParameters.map { it.firValueParameter }
delegatedConstructor = firDelegatedCall
this.body = body
}, valueParameters
)
}
@@ -1303,7 +1316,9 @@ class DeclarationsConverter(
val delegatedSuperTypeRef: FirTypeRef?,
val superTypesRef: List<FirTypeRef>,
val delegatedConstructorArguments: List<FirExpression>,
val delegatedConstructorSource: FirLightSourceElement?
val delegatedConstructorSource: FirLightSourceElement?,
val delegateFields: List<FirField>,
val primaryConstructorBody: FirBlock?
)
private fun convertDelegationSpecifiers(delegationSpecifiers: LighterASTNode): DelegationSpecifiers {
@@ -1311,6 +1326,9 @@ class DeclarationsConverter(
val superTypeCallEntry = mutableListOf<FirExpression>()
var delegatedSuperTypeRef: FirTypeRef? = null
var delegateConstructorSource: FirLightSourceElement? = null
val delegateFields = mutableListOf<FirField>()
val initializeDelegateStatements = mutableListOf<FirStatement>()
var delegateNumber = 0
delegationSpecifiers.forEachChildren {
when (it.tokenType) {
SUPER_TYPE_ENTRY -> superTypeRefs += convertType(it)
@@ -1320,10 +1338,23 @@ class DeclarationsConverter(
superTypeCallEntry += second
delegateConstructorSource = it.toFirSourceElement()
}
DELEGATED_SUPER_TYPE_ENTRY -> superTypeRefs += convertExplicitDelegation(it)
DELEGATED_SUPER_TYPE_ENTRY -> {
superTypeRefs += convertExplicitDelegation(it, delegateNumber, delegateFields, initializeDelegateStatements)
delegateNumber++
}
}
}
return DelegationSpecifiers(delegatedSuperTypeRef, superTypeRefs, superTypeCallEntry, delegateConstructorSource)
val body = if (initializeDelegateStatements.isNotEmpty()) {
buildBlock {
for (statement in initializeDelegateStatements) {
statements += statement
}
}
} else null
return DelegationSpecifiers(
delegatedSuperTypeRef, superTypeRefs, superTypeCallEntry, delegateConstructorSource,
delegateFields, body
)
}
/**
@@ -1352,7 +1383,12 @@ class DeclarationsConverter(
* : userType "by" element
* ;
*/
private fun convertExplicitDelegation(explicitDelegation: LighterASTNode): FirDelegatedTypeRef {
private fun convertExplicitDelegation(
explicitDelegation: LighterASTNode,
delegateNumber: Int,
delegateFields: MutableList<FirField>,
initializeDelegateStatements: MutableList<FirStatement>
): FirTypeRef {
lateinit var firTypeRef: FirTypeRef
var firExpression: FirExpression? = buildErrorExpression(
explicitDelegation.toFirSourceElement(), ConeSimpleDiagnostic("Should have delegate", DiagnosticKind.Syntax)
@@ -1364,10 +1400,30 @@ class DeclarationsConverter(
}
}
return buildDelegatedTypeRef {
delegate = firExpression
typeRef = firTypeRef
}
val delegateName = Name.identifier("\$\$delegate_$delegateNumber")
delegateFields.add(
buildField {
source = firExpression!!.source
session = baseSession
origin = FirDeclarationOrigin.Synthetic
name = delegateName
returnTypeRef = firTypeRef!!
symbol = FirFieldSymbol(CallableId(name))
isVar = false
status = FirDeclarationStatusImpl(Visibilities.LOCAL, Modality.FINAL)
}
)
initializeDelegateStatements.add(
buildVariableAssignment {
source = firExpression!!.source
calleeReference =
buildSimpleNamedReference {
name = delegateName
}
rValue = firExpression!!
}
)
return firTypeRef
}
/***** TYPES *****/
@@ -28,6 +28,7 @@ import org.jetbrains.kotlin.fir.expressions.impl.FirSingleExpressionBlock
import org.jetbrains.kotlin.fir.references.FirNamedReference
import org.jetbrains.kotlin.fir.references.builder.*
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
import org.jetbrains.kotlin.fir.symbols.CallableId
import org.jetbrains.kotlin.fir.symbols.impl.*
import org.jetbrains.kotlin.fir.types.*
import org.jetbrains.kotlin.fir.types.builder.*
@@ -48,7 +49,6 @@ import org.jetbrains.kotlin.util.OperatorNameConventions
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
import java.util.*
import org.jetbrains.kotlin.utils.addToStdlib.runIf
import kotlin.collections.contains
class RawFirBuilder(
session: FirSession, val baseScopeProvider: FirScopeProvider, val stubMode: Boolean
@@ -459,6 +459,8 @@ class RawFirBuilder(
): FirTypeRef {
var superTypeCallEntry: KtSuperTypeCallEntry? = null
var delegatedSuperTypeRef: FirTypeRef? = null
var delegateNumber = 0
val initializeDelegateStatements = mutableListOf<FirStatement>()
for (superTypeListEntry in superTypeListEntries) {
when (superTypeListEntry) {
is KtSuperTypeEntry -> {
@@ -471,10 +473,32 @@ class RawFirBuilder(
}
is KtDelegatedSuperTypeEntry -> {
val type = superTypeListEntry.typeReference.toFirOrErrorType()
container.superTypeRefs += buildDelegatedTypeRef {
delegate = { superTypeListEntry.delegateExpression }.toFirExpression("Should have delegate")
typeRef = type
val delegateExpression = { superTypeListEntry.delegateExpression }.toFirExpression("Should have delegate")
container.superTypeRefs += type
val delegateName = Name.identifier("\$\$delegate_$delegateNumber")
val delegateSource = superTypeListEntry.delegateExpression?.toFirSourceElement()
val delegateField = buildField {
source = delegateSource
session = baseSession
origin = FirDeclarationOrigin.Synthetic
name = delegateName
returnTypeRef = type
symbol = FirFieldSymbol(CallableId(name))
isVar = false
status = FirDeclarationStatusImpl(Visibilities.LOCAL, Modality.FINAL)
}
initializeDelegateStatements.add(
buildVariableAssignment {
source = delegateSource
calleeReference =
buildSimpleNamedReference {
name = delegateName
}
rValue = delegateExpression
}
)
container.declarations.add(delegateField)
delegateNumber ++
}
}
}
@@ -526,8 +550,14 @@ class RawFirBuilder(
delegatedSuperTypeRef,
delegatedSelfTypeRef ?: delegatedSuperTypeRef,
owner = this,
containerTypeParameters
containerTypeParameters,
body = if (initializeDelegateStatements.isNotEmpty()) buildBlock {
for (statement in initializeDelegateStatements) {
statements += statement
}
} else null
)
container.declarations += firPrimaryConstructor
return delegatedSuperTypeRef
}
@@ -537,7 +567,8 @@ class RawFirBuilder(
delegatedSuperTypeRef: FirTypeRef,
delegatedSelfTypeRef: FirTypeRef,
owner: KtClassOrObject,
ownerTypeParameters: List<FirTypeParameterRef>
ownerTypeParameters: List<FirTypeParameterRef>,
body: FirBlock? = null
): FirConstructor {
val constructorCallee = superTypeCallEntry?.calleeExpression?.toFirSourceElement()
val constructorSource = this?.toFirSourceElement()
@@ -577,6 +608,7 @@ class RawFirBuilder(
typeParameters += constructorTypeParametersFromConstructedClass(ownerTypeParameters)
this@toFirConstructor?.extractAnnotationsTo(this)
this@toFirConstructor?.extractValueParametersTo(this)
this.body = body
}
}
@@ -719,7 +751,7 @@ class RawFirBuilder(
classOrObject.extractSuperTypeListEntriesTo(this, delegatedSelfType, null, classKind, typeParameters)
val primaryConstructor = classOrObject.primaryConstructor
val firPrimaryConstructor = declarations.firstOrNull() as? FirConstructor
val firPrimaryConstructor = declarations.firstOrNull {it is FirConstructor} as? FirConstructor
if (primaryConstructor != null && firPrimaryConstructor != null) {
primaryConstructor.valueParameters.zip(
firPrimaryConstructor.valueParameters
@@ -138,6 +138,14 @@ class FirStatusResolveTransformer(
return transformDeclaration(property, data)
}
override fun transformField(
field: FirField,
data: FirDeclarationStatus?
): CompositeTransformResult<FirDeclaration> {
field.transformStatus(this, field.resolveStatus(field.status, containingClass, isLocal = false))
return transformDeclaration(field, data)
}
override fun transformEnumEntry(enumEntry: FirEnumEntry, data: FirDeclarationStatus?): CompositeTransformResult<FirDeclaration> {
return transformDeclaration(enumEntry, data)
}
@@ -741,7 +741,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
else
staticsAndCompanion
val constructor = (owner as? FirRegularClass)?.declarations?.firstOrNull() as? FirConstructor
val constructor = (owner as? FirRegularClass)?.declarations?.firstOrNull { it is FirConstructor } as? FirConstructor
val primaryConstructorParametersScope =
if (constructor?.isPrimary == true) {
constructor.valueParameters.fold(FirLocalScope()) { acc, param -> acc.storeVariable(param) }
@@ -9,8 +9,8 @@ import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.fir.declarations.builder.FirRegularClassBuilder
import org.jetbrains.kotlin.fir.declarations.builder.FirTypeParameterBuilder
import org.jetbrains.kotlin.fir.declarations.impl.FirRegularClassImpl
import org.jetbrains.kotlin.fir.declarations.impl.FirFileImpl
import org.jetbrains.kotlin.fir.declarations.impl.FirRegularClassImpl
import org.jetbrains.kotlin.fir.symbols.impl.FirAnonymousObjectSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
@@ -119,4 +119,7 @@ var FirProperty.isFromVararg: Boolean? by FirDeclarationDataRegistry.data(IsFrom
fun FirAnnotatedDeclaration.hasAnnotation(classId: ClassId): Boolean {
return annotations.any { it.annotationTypeRef.coneTypeSafe<ConeClassLikeType>()?.classId == classId }
}
}
inline val FirDeclaration.isSynthetic: Boolean
get() = origin == FirDeclarationOrigin.Synthetic
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A<T> {
fun foo(): T
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A<T> {
var result: T
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A<T> {
fun foo(t: T): String
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface Trait1 {
fun foo() : String
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// Changed when traits were introduced. May not make sense any more
open class X(val x : Int) {}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
fun foo(): Int
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface Trait {
fun foo() = "O"
fun bar(): String
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
val result: String
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
fun foo(): Int
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
fun foo(): String
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A {
fun foo(): String
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FULL_JDK
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// SKIP_JDK6
// TARGET_BACKEND: JVM
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
public interface Base {
fun test() = "base fail"
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface A<T> {
fun foo(): T
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// SKIP_JDK6
// TARGET_BACKEND: JVM
// FILE: Base.java
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface IFoo {
fun foo(): String
}
@@ -1,5 +1,4 @@
// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
interface IFoo {
fun getO(): String
@@ -1,6 +1,5 @@
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.test.assertEquals
interface IFoo {
@@ -1,6 +1,5 @@
// KJS_WITH_FULL_RUNTIME
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
import kotlin.test.assertEquals
interface IFoo {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface TextField {
fun getText(): String
fun setText(text: String)
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
interface FooTrait {
val propertyTest: String
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
internal interface A {
fun foo(): String
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class Thing(delegate: CharSequence) : CharSequence by delegate
fun box(): String {
@@ -1,6 +1,5 @@
// !LANGUAGE: +DoNotGenerateThrowsForDelegatedKotlinMembers
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// FILE: A.kt
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// The old backend thinks `toArray(): Array<Int?>` is the same as `toArray(): Array<Any?>`
// IGNORE_BACKEND: JVM
@@ -4,5 +4,5 @@ interface T
annotation class Ann: C()
annotation class Ann2: T
annotation class Ann3: T by a
annotation class Ann3: T by <!ANNOTATION_CLASS_MEMBER!>a<!>
annotation class Ann4: C(), T
@@ -1,3 +1,3 @@
class C : Base1 by Base2(1) {
class C : Base1 by <!UNRESOLVED_REFERENCE!>Base2<!>(1) {
fun test() { }
}
@@ -46,34 +46,59 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[<root>.IBase<E of <root>.Test1>]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <B> ($this:<root>.IBase<A of <root>.IBase>, a:E of <root>.Test1, b:B of <root>.Test1.foo) returnType:kotlin.Unit [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1' type=<root>.Test1<E of <root>.Test1> origin=null
value: GET_VAR 'i: <root>.IBase<E of <root>.Test1> declared in <root>.Test1.<init>' type=<root>.IBase<E of <root>.Test1> origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>, a:A of <root>.IBase, b:B of <root>.IBase.foo) returnType:kotlin.Unit
overridden:
public abstract fun foo <B> (a: A of <root>.IBase, b: B of <root>.IBase.foo): kotlin.Unit declared in <root>.IBase
TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
VALUE_PARAMETER name:a index:0 type:E of <root>.Test1
VALUE_PARAMETER name:b index:1 type:B of <root>.Test1.foo
PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:ABSTRACT <C> ($this:<root>.IBase<A of <root>.IBase>) returnType:kotlin.collections.Map<E of <root>.Test1, C of <root>.Test1.<get-id>>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1<E of <root>.Test1>
VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:A of <root>.IBase
VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of <root>.IBase.foo
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>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.foo' type=<root>.Test1<E of <root>.Test1> origin=null
a: GET_VAR 'a: A of <root>.IBase declared in <root>.Test1.foo' type=A of <root>.IBase origin=null
b: GET_VAR 'b: B of <root>.IBase.foo declared in <root>.Test1.foo' type=B of <root>.IBase.foo origin=null
PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-id> visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>) returnType:kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>?
correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
overridden:
public abstract fun <get-id> <C> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>? declared in <root>.IBase
TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <D> ($this:<root>.IBase<A of <root>.IBase>) returnType:D of <root>.Test1.<get-x>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1<E of <root>.Test1>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-id> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>? declared in <root>.Test1'
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<A of <root>.IBase, C of <root>.IBase.<get-id>>? origin=null
<C>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.<get-id>' type=<root>.Test1<E of <root>.Test1> origin=null
PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
FUN DELEGATED_MEMBER name:<get-x> visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>) returnType:D of <root>.IBase.<get-x>?
correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
overridden:
public abstract fun <get-x> <D> (): D of <root>.IBase.<get-x>? declared in <root>.IBase
TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
FUN FAKE_OVERRIDE name:<set-x> visibility:public modality:ABSTRACT <D> ($this:<root>.IBase<A of <root>.IBase>, <set-?>:D of <root>.Test1.<set-x>?) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1<E of <root>.Test1>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-x> (): D of <root>.IBase.<get-x>? declared in <root>.Test1'
CALL 'public abstract fun <get-x> <D> (): D of <root>.IBase.<get-x>? declared in <root>.IBase' type=D of <root>.IBase.<get-x>? origin=null
<D>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.<get-x>' type=<root>.Test1<E of <root>.Test1> origin=null
FUN DELEGATED_MEMBER name:<set-x> visibility:public modality:OPEN <> ($this:<root>.Test1<E of <root>.Test1>, <set-?>:D of <root>.IBase.<set-x>?) returnType:kotlin.Unit
correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
overridden:
public abstract fun <set-x> <D> (<set-?>: D of <root>.IBase.<set-x>?): kotlin.Unit declared in <root>.IBase
TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
VALUE_PARAMETER name:<set-?> index:0 type:D of <root>.Test1.<set-x>?
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1<E of <root>.Test1>
VALUE_PARAMETER DELEGATED_MEMBER name:<set-?> index:0 type:D of <root>.IBase.<set-x>?
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>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<E of <root>.Test1> visibility:local [final]' type=<root>.IBase<E of <root>.Test1> origin=null
receiver: GET_VAR '<this>: <root>.Test1<E of <root>.Test1> declared in <root>.Test1.<set-x>' type=<root>.Test1<E of <root>.Test1> origin=null
<set-?>: GET_VAR '<set-?>: D of <root>.IBase.<set-x>? declared in <root>.Test1.<set-x>' type=D of <root>.IBase.<set-x>? origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<E of <root>.Test1> visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -94,6 +119,9 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[<root>.IBase<kotlin.String>]'
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<kotlin.String> visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2' type=<root>.Test2 origin=null
value: 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
@@ -113,34 +141,56 @@ FILE fqName:<root> fileName:/delegatedGenericImplementation.kt
SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:<root>.IBase<kotlin.String> visibility:private' type=kotlin.Unit origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<set-j>' type=<root>.Test2 origin=null
value: GET_VAR '<set-?>: <root>.IBase<kotlin.String> declared in <root>.Test2.<set-j>' type=<root>.IBase<kotlin.String> origin=null
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <B> ($this:<root>.IBase<A of <root>.IBase>, a:kotlin.String, b:B of <root>.Test2.foo) returnType:kotlin.Unit [fake_override]
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test2, a:A of <root>.IBase, b:B of <root>.IBase.foo) returnType:kotlin.Unit
overridden:
public abstract fun foo <B> (a: A of <root>.IBase, b: B of <root>.IBase.foo): kotlin.Unit declared in <root>.IBase
TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
VALUE_PARAMETER name:a index:0 type:kotlin.String
VALUE_PARAMETER name:b index:1 type:B of <root>.Test2.foo
PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:ABSTRACT <C> ($this:<root>.IBase<A of <root>.IBase>) returnType:kotlin.collections.Map<kotlin.String, C of <root>.Test2.<get-id>>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:A of <root>.IBase
VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of <root>.IBase.foo
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>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<kotlin.String> visibility:local [final]' 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: A of <root>.IBase declared in <root>.Test2.foo' type=A of <root>.IBase origin=null
b: GET_VAR 'b: B of <root>.IBase.foo declared in <root>.Test2.foo' type=B of <root>.IBase.foo origin=null
PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-id> visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>?
correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
overridden:
public abstract fun <get-id> <C> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<get-id>>? declared in <root>.IBase
TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <D> ($this:<root>.IBase<A of <root>.IBase>) returnType:D of <root>.Test2.<get-x>? [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-id> (): kotlin.collections.Map<A of <root>.IBase, C of <root>.IBase.<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<A of <root>.IBase, C of <root>.IBase.<get-id>>? origin=null
<C>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-id>' type=<root>.Test2 origin=null
PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
FUN DELEGATED_MEMBER name:<get-x> visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:D of <root>.IBase.<get-x>?
correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
overridden:
public abstract fun <get-x> <D> (): D of <root>.IBase.<get-x>? declared in <root>.IBase
TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
FUN FAKE_OVERRIDE name:<set-x> visibility:public modality:ABSTRACT <D> ($this:<root>.IBase<A of <root>.IBase>, <set-?>:D of <root>.Test2.<set-x>?) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-x> (): D of <root>.IBase.<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>.IBase.<get-x>? origin=null
<D>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-x>' type=<root>.Test2 origin=null
FUN DELEGATED_MEMBER name:<set-x> visibility:public modality:OPEN <> ($this:<root>.Test2, <set-?>:D of <root>.IBase.<set-x>?) returnType:kotlin.Unit
correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var]
overridden:
public abstract fun <set-x> <D> (<set-?>: D of <root>.IBase.<set-x>?): kotlin.Unit declared in <root>.IBase
TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<A of <root>.IBase>
VALUE_PARAMETER name:<set-?> index:0 type:D of <root>.Test2.<set-x>?
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
VALUE_PARAMETER DELEGATED_MEMBER name:<set-?> index:0 type:D of <root>.IBase.<set-x>?
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>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<kotlin.String> visibility:local [final]' type=<root>.IBase<kotlin.String> origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<set-x>' type=<root>.Test2 origin=null
<set-?>: GET_VAR '<set-?>: D of <root>.IBase.<set-x>? declared in <root>.Test2.<set-x>' type=D of <root>.IBase.<set-x>? origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<kotlin.String> visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -200,21 +200,39 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[<root>.IBase]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IBase, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1' type=<root>.Test1 origin=null
value: GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[<root>.IBase]' type=<root>.BaseImpl
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test1, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
overridden:
public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:s index:1 type:kotlin.String
FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:<root>.IBase) returnType:kotlin.Int [fake_override]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1
VALUE_PARAMETER DELEGATED_MEMBER name:x index:0 type:kotlin.Int
VALUE_PARAMETER DELEGATED_MEMBER name:s index:1 type:kotlin.String
BLOCK_BODY
CALL 'public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=<root>.IBase origin=null
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.foo' type=<root>.Test1 origin=null
x: GET_VAR 'x: kotlin.Int declared in <root>.Test1.foo' type=kotlin.Int origin=null
s: GET_VAR 's: kotlin.String declared in <root>.Test1.foo' type=kotlin.String origin=null
FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:<root>.Test1) returnType:kotlin.Int
overridden:
public abstract fun bar (): kotlin.Int declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase
FUN FAKE_OVERRIDE name:qux visibility:public modality:ABSTRACT <> ($this:<root>.IBase, $receiver:kotlin.String) returnType:kotlin.Unit [fake_override]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in <root>.Test1'
CALL 'public abstract fun bar (): kotlin.Int declared in <root>.IBase' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=<root>.IBase origin=null
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.bar' type=<root>.Test1 origin=null
FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:<root>.Test1) returnType:kotlin.Unit
overridden:
public abstract fun qux (): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test1
BLOCK_BODY
CALL 'public abstract fun qux (): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=<root>.IBase origin=null
receiver: GET_VAR '<this>: <root>.Test1 declared in <root>.Test1.qux' type=<root>.Test1 origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -234,21 +252,111 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[<root>.IBase; <root>.IOther]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IBase, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2' type=<root>.Test2 origin=null
value: GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[<root>.IBase]' type=<root>.BaseImpl
SET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2' type=<root>.Test2 origin=null
value: CALL 'public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): <root>.IOther declared in <root>' type=<root>.IOther origin=null
x0: CONST String type=kotlin.String value=""
y0: CONST Int type=kotlin.Int value=42
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test2, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit
overridden:
public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase
VALUE_PARAMETER name:x index:0 type:kotlin.Int
VALUE_PARAMETER name:s index:1 type:kotlin.String
FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:<root>.IBase) returnType:kotlin.Int [fake_override]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
VALUE_PARAMETER DELEGATED_MEMBER name:x index:0 type:kotlin.Int
VALUE_PARAMETER DELEGATED_MEMBER name:s index:1 type:kotlin.String
BLOCK_BODY
CALL 'public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=<root>.IBase origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.foo' type=<root>.Test2 origin=null
x: GET_VAR 'x: kotlin.Int declared in <root>.Test2.foo' type=kotlin.Int origin=null
s: GET_VAR 's: kotlin.String declared in <root>.Test2.foo' type=kotlin.String origin=null
FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.Int
overridden:
public abstract fun bar (): kotlin.Int declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase
FUN FAKE_OVERRIDE name:qux visibility:public modality:ABSTRACT <> ($this:<root>.IBase, $receiver:kotlin.String) returnType:kotlin.Unit [fake_override]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in <root>.Test2'
CALL 'public abstract fun bar (): kotlin.Int declared in <root>.IBase' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=<root>.IBase origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.bar' type=<root>.Test2 origin=null
FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.Unit
overridden:
public abstract fun qux (): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase
$receiver: VALUE_PARAMETER name:<this> type:kotlin.String
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
CALL 'public abstract fun qux (): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]' type=<root>.IBase origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.qux' type=<root>.Test2 origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IBase visibility:local [final]
PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-x> visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.String
correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val]
overridden:
public abstract fun <get-x> (): kotlin.String declared in <root>.IOther
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-x> (): kotlin.String declared in <root>.Test2'
CALL 'public abstract fun <get-x> (): kotlin.String declared in <root>.IOther' type=kotlin.String origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=<root>.IOther origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-x>' type=<root>.Test2 origin=null
PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var]
FUN DELEGATED_MEMBER name:<get-y> visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.Int
correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var]
overridden:
public abstract fun <get-y> (): kotlin.Int declared in <root>.IOther
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-y> (): kotlin.Int declared in <root>.Test2'
CALL 'public abstract fun <get-y> (): kotlin.Int declared in <root>.IOther' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=<root>.IOther origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-y>' type=<root>.Test2 origin=null
FUN DELEGATED_MEMBER name:<set-y> visibility:public modality:OPEN <> ($this:<root>.Test2, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var]
overridden:
public abstract fun <set-y> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.IOther
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
VALUE_PARAMETER DELEGATED_MEMBER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public abstract fun <set-y> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.IOther' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=<root>.IOther origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<set-y>' type=<root>.Test2 origin=null
<set-?>: GET_VAR '<set-?>: kotlin.Int declared in <root>.Test2.<set-y>' type=kotlin.Int origin=null
PROPERTY DELEGATED_MEMBER name:z1 visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-z1> visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.Int
correspondingProperty: PROPERTY DELEGATED_MEMBER name:z1 visibility:public modality:OPEN [val]
overridden:
public abstract fun <get-z1> (): kotlin.Int declared in <root>.IOther
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-z1> (): kotlin.Int declared in <root>.Test2'
CALL 'public abstract fun <get-z1> (): kotlin.Int declared in <root>.IOther' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=<root>.IOther origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-z1>' type=<root>.Test2 origin=null
PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var]
FUN DELEGATED_MEMBER name:<get-z2> visibility:public modality:OPEN <> ($this:<root>.Test2) returnType:kotlin.Int
correspondingProperty: PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var]
overridden:
public abstract fun <get-z2> (): kotlin.Int declared in <root>.IOther
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-z2> (): kotlin.Int declared in <root>.Test2'
CALL 'public abstract fun <get-z2> (): kotlin.Int declared in <root>.IOther' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=<root>.IOther origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<get-z2>' type=<root>.Test2 origin=null
FUN DELEGATED_MEMBER name:<set-z2> visibility:public modality:OPEN <> ($this:<root>.Test2, <set-?>:kotlin.Int) returnType:kotlin.Unit
correspondingProperty: PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var]
overridden:
public abstract fun <set-z2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.IOther
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test2
VALUE_PARAMETER DELEGATED_MEMBER name:<set-?> index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public abstract fun <set-z2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.IOther' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]' type=<root>.IOther origin=null
receiver: GET_VAR '<this>: <root>.Test2 declared in <root>.Test2.<set-z2>' type=<root>.Test2 origin=null
<set-?>: GET_VAR '<set-?>: kotlin.Int declared in <root>.Test2.<set-z2>' type=kotlin.Int origin=null
FIELD DELEGATE name:$$delegate_1 type:<root>.IOther visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -262,39 +370,3 @@ FILE fqName:<root> fileName:/delegatedImplementation.kt
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-x> visibility:public modality:ABSTRACT <> ($this:<root>.IOther) returnType:kotlin.String [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,val]
overridden:
public abstract fun <get-x> (): kotlin.String declared in <root>.IOther
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
PROPERTY FAKE_OVERRIDE name:y visibility:public modality:ABSTRACT [fake_override,var]
FUN FAKE_OVERRIDE name:<get-y> visibility:public modality:ABSTRACT <> ($this:<root>.IOther) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <get-y> (): kotlin.Int declared in <root>.IOther
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
FUN FAKE_OVERRIDE name:<set-y> visibility:public modality:ABSTRACT <> ($this:<root>.IOther, <set-?>:kotlin.Int) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <set-y> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.IOther
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
PROPERTY FAKE_OVERRIDE name:z1 visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-z1> visibility:public modality:ABSTRACT <> ($this:<root>.IOther) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:z1 visibility:public modality:ABSTRACT [fake_override,val]
overridden:
public abstract fun <get-z1> (): kotlin.Int declared in <root>.IOther
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
PROPERTY FAKE_OVERRIDE name:z2 visibility:public modality:ABSTRACT [fake_override,var]
FUN FAKE_OVERRIDE name:<get-z2> visibility:public modality:ABSTRACT <> ($this:<root>.IOther) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:z2 visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <get-z2> (): kotlin.Int declared in <root>.IOther
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
FUN FAKE_OVERRIDE name:<set-z2> visibility:public modality:ABSTRACT <> ($this:<root>.IOther, <set-?>:kotlin.Int) returnType:kotlin.Unit [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:z2 visibility:public modality:ABSTRACT [fake_override,var]
overridden:
public abstract fun <set-z2> (<set-?>: kotlin.Int): kotlin.Unit declared in <root>.IOther
$this: VALUE_PARAMETER name:<this> type:<root>.IOther
VALUE_PARAMETER name:<set-?> index:0 type:kotlin.Int
@@ -53,15 +53,23 @@ FILE fqName:<root> fileName:/delegatedImplementationWithExplicitOverride.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[<root>.IFooBar]'
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFooBar visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.C declared in <root>.C' type=<root>.C origin=null
value: GET_OBJECT 'CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[<root>.IFooBar]' type=<root>.FooBarImpl
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.C) returnType:kotlin.Unit
overridden:
public abstract fun bar (): kotlin.Unit declared in <root>.IFooBar
$this: VALUE_PARAMETER name:<this> type:<root>.C
BLOCK_BODY
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFooBar) returnType:kotlin.Unit [fake_override]
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.C) returnType:kotlin.Unit
overridden:
public abstract fun foo (): kotlin.Unit declared in <root>.IFooBar
$this: VALUE_PARAMETER name:<this> type:<root>.IFooBar
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.C
BLOCK_BODY
CALL 'public abstract fun foo (): kotlin.Unit declared in <root>.IFooBar' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFooBar visibility:local [final]' type=<root>.IFooBar origin=null
receiver: GET_VAR '<this>: <root>.C declared in <root>.C.foo' type=<root>.C origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IFooBar visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -123,10 +123,19 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[<root>.IFoo]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.TestJFoo declared in <root>.TestJFoo' type=<root>.TestJFoo origin=null
value: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFoo' type=<root>.JFoo origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestJFoo) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.TestJFoo
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestJFoo'
CALL 'public abstract fun foo (): 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
receiver: GET_VAR '<this>: <root>.TestJFoo declared in <root>.TestJFoo.foo' type=<root>.TestJFoo origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -146,10 +155,19 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.TestK1 declared in <root>.TestK1' type=<root>.TestK1 origin=null
value: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K1' type=<root>.K1 origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK1) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.TestK1
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK1'
CALL 'public abstract fun foo (): 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
receiver: GET_VAR '<this>: <root>.TestK1 declared in <root>.TestK1.foo' type=<root>.TestK1 origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -169,10 +187,19 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.TestK2 declared in <root>.TestK2' type=<root>.TestK2 origin=null
value: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K2' type=<root>.K2 origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK2) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.TestK2
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK2'
CALL 'public abstract fun foo (): 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
receiver: GET_VAR '<this>: <root>.TestK2 declared in <root>.TestK2.foo' type=<root>.TestK2 origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -192,10 +219,19 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.TestK3 declared in <root>.TestK3' type=<root>.TestK3 origin=null
value: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K3' type=<root>.K3 origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK3) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.TestK3
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK3'
CALL 'public abstract fun foo (): 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
receiver: GET_VAR '<this>: <root>.TestK3 declared in <root>.TestK3.foo' type=<root>.TestK3 origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -215,10 +251,19 @@ FILE fqName:<root> fileName:/implicitNotNullOnDelegatedImplementation.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[<root>.IFoo]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IFoo) returnType:kotlin.String [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.TestK4 declared in <root>.TestK4' type=<root>.TestK4 origin=null
value: CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.K4' type=<root>.K4 origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.TestK4) returnType:kotlin.String
overridden:
public abstract fun foo (): kotlin.String declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:<root>.IFoo
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.TestK4
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in <root>.TestK4'
CALL 'public abstract fun foo (): 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
receiver: GET_VAR '<this>: <root>.TestK4 declared in <root>.TestK4.foo' type=<root>.TestK4 origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IFoo visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
+14 -4
View File
@@ -30,12 +30,22 @@ FILE fqName:<root> fileName:/kt35550.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[<root>.I]'
PROPERTY FAKE_OVERRIDE name:id visibility:public modality:OPEN [fake_override,val]
FUN FAKE_OVERRIDE name:<get-id> visibility:public modality:OPEN <> ($this:<root>.I) returnType:T of <root>.I.<get-id> [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:OPEN [fake_override,val]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.I visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.A declared in <root>.A' type=<root>.A origin=null
value: GET_VAR 'i: <root>.I declared in <root>.A.<init>' type=<root>.I origin=null
PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-id> visibility:public modality:OPEN <> ($this:<root>.A) returnType:T of <root>.I.<get-id>
correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val]
overridden:
public open fun <get-id> <T> (): T of <root>.I.<get-id> declared in <root>.I
$this: VALUE_PARAMETER name:<this> type:<root>.I
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.A
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-id> (): T of <root>.I.<get-id> declared in <root>.A'
CALL 'public open fun <get-id> <T> (): T of <root>.I.<get-id> declared in <root>.I' type=T of <root>.I.<get-id> origin=null
<T>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.I visibility:local [final]' type=<root>.I origin=null
receiver: GET_VAR '<this>: <root>.A declared in <root>.A.<get-id>' type=<root>.A origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.I visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
@@ -35,24 +35,44 @@ FILE fqName:<root> fileName:/delegatedMembers.kt
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[<root>.IBase<TT of <root>.Test>]'
FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:<root>.IBase<T of <root>.IBase>, x:kotlin.Int) returnType:kotlin.Unit [fake_override]
SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]' type=kotlin.Unit origin=EQ
receiver: GET_VAR '<this>: <root>.Test<TT of <root>.Test> declared in <root>.Test' type=<root>.Test<TT of <root>.Test> origin=null
value: GET_VAR 'impl: <root>.IBase<TT of <root>.Test> declared in <root>.Test.<init>' type=<root>.IBase<TT of <root>.Test> origin=null
FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:<root>.Test<TT of <root>.Test>, x:kotlin.Int) returnType:kotlin.Unit
overridden:
public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<T of <root>.IBase>
VALUE_PARAMETER name:x index:0 type:kotlin.Int
PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val]
FUN FAKE_OVERRIDE name:<get-bar> visibility:public modality:ABSTRACT <> ($this:<root>.IBase<T of <root>.IBase>) returnType:kotlin.Int [fake_override]
correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test<TT of <root>.Test>
VALUE_PARAMETER DELEGATED_MEMBER name:x index:0 type:kotlin.Int
BLOCK_BODY
CALL 'public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]' type=<root>.IBase<TT of <root>.Test> origin=null
receiver: GET_VAR '<this>: <root>.Test<TT of <root>.Test> declared in <root>.Test.foo' type=<root>.Test<TT of <root>.Test> origin=null
x: GET_VAR 'x: kotlin.Int declared in <root>.Test.foo' type=kotlin.Int origin=null
PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val]
FUN DELEGATED_MEMBER name:<get-bar> visibility:public modality:OPEN <> ($this:<root>.Test<TT of <root>.Test>) returnType:kotlin.Int
correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val]
overridden:
public abstract fun <get-bar> (): kotlin.Int declared in <root>.IBase
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<T of <root>.IBase>
FUN FAKE_OVERRIDE name:qux visibility:public modality:ABSTRACT <X> ($this:<root>.IBase<T of <root>.IBase>, t:TT of <root>.Test, x:X of <root>.Test.qux) returnType:kotlin.Unit [fake_override]
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test<TT of <root>.Test>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public open fun <get-bar> (): kotlin.Int declared in <root>.Test'
CALL 'public abstract fun <get-bar> (): kotlin.Int declared in <root>.IBase' type=kotlin.Int origin=null
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]' type=<root>.IBase<TT of <root>.Test> origin=null
receiver: GET_VAR '<this>: <root>.Test<TT of <root>.Test> declared in <root>.Test.<get-bar>' type=<root>.Test<TT of <root>.Test> origin=null
FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:<root>.Test<TT of <root>.Test>, t:T of <root>.IBase, x:X of <root>.IBase.qux) returnType:kotlin.Unit
overridden:
public abstract fun qux <X> (t: T of <root>.IBase, x: X of <root>.IBase.qux): kotlin.Unit declared in <root>.IBase
TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?]
$this: VALUE_PARAMETER name:<this> type:<root>.IBase<T of <root>.IBase>
VALUE_PARAMETER name:t index:0 type:TT of <root>.Test
VALUE_PARAMETER name:x index:1 type:X of <root>.Test.qux
$this: VALUE_PARAMETER DELEGATED_MEMBER name:<this> type:<root>.Test<TT of <root>.Test>
VALUE_PARAMETER DELEGATED_MEMBER name:t index:0 type:T of <root>.IBase
VALUE_PARAMETER DELEGATED_MEMBER name:x index:1 type:X of <root>.IBase.qux
BLOCK_BODY
CALL 'public abstract fun qux <X> (t: T of <root>.IBase, x: X of <root>.IBase.qux): kotlin.Unit declared in <root>.IBase' type=kotlin.Unit origin=null
<X>: <none>
$this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]' type=<root>.IBase<TT of <root>.Test> origin=null
receiver: GET_VAR '<this>: <root>.Test<TT of <root>.Test> declared in <root>.Test.qux' type=<root>.Test<TT of <root>.Test> origin=null
t: GET_VAR 't: T of <root>.IBase declared in <root>.Test.qux' type=T of <root>.IBase origin=null
x: GET_VAR 'x: X of <root>.IBase.qux declared in <root>.Test.qux' type=X of <root>.IBase.qux origin=null
FIELD DELEGATE name:$$delegate_0 type:<root>.IBase<TT of <root>.Test> visibility:local [final]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any