diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java index 0c5b20dbeba..457db0f0a30 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java @@ -54,6 +54,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInObject.kt") public void testClassInObject() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/classInObject.kt"); diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 4ae34240eab..3f083066ccb 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -15937,6 +15937,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/ir/anonymousObjectInsideElvis.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInitializers.kt") public void testClassInitializers() throws Exception { runTest("compiler/testData/codegen/box/ir/classInitializers.kt"); diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java index a6d9d2f26b7..8f879e3820d 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java @@ -56,6 +56,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classMembers.kt") public void testClassMembers() throws Exception { runTest("compiler/testData/ir/irText/classes/classMembers.kt"); diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IdSignature.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IdSignature.kt index 7c47602d92e..6be2a847b46 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IdSignature.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/IdSignature.kt @@ -114,6 +114,64 @@ sealed class IdSignature { override fun hashCode(): Int = accessorSignature.hashCode() } + // KT-42020 + // This special signature is required to disambiguate fake overrides 'foo(x: T)[T = String]' and 'foo(x: String)' in the code below: + // + // open class Base { + // fun foo(x: T) {} + // fun foo(x: String) {} + // } + // + // class Derived : Base() + // + // (NB similar clash is possible for generic member extension properties as well) + // + // For each fake override 'foo' we collect non-fake overrides overridden by 'foo' + // such that their value parameter types contain type parameters of 'Base', + // sorted by the fully-qualified name of the containing class. + // + // NB this special case of IdSignature is JVM-specific. + class SpecialFakeOverrideSignature( + val memberSignature: IdSignature, + val overriddenSignatures: List + ) : IdSignature() { + override val isPublic: Boolean + get() = memberSignature.isPublic + + override fun topLevelSignature(): IdSignature = + memberSignature.topLevelSignature() + + override fun nearestPublicSig(): IdSignature = + if (memberSignature.isPublic) + this + else + memberSignature.nearestPublicSig() + + override fun packageFqName(): FqName = + memberSignature.packageFqName() + + override fun render(): String = + memberSignature.render() + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as SpecialFakeOverrideSignature + + if (memberSignature != other.memberSignature) return false + if (overriddenSignatures != other.overriddenSignatures) return false + + return true + } + + override fun hashCode(): Int { + var result = memberSignature.hashCode() + result = 31 * result + overriddenSignatures.hashCode() + return result + } + } + class FileLocalSignature(val container: IdSignature, val id: Long) : IdSignature() { override val isPublic: Boolean get() = false diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/signature/IdSignatureBuilder.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/signature/IdSignatureBuilder.kt index 787f6e27202..fd46fd7cdc0 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/signature/IdSignatureBuilder.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/signature/IdSignatureBuilder.kt @@ -14,6 +14,7 @@ abstract class IdSignatureBuilder { protected val classFqnSegments = mutableListOf() protected var hashId: Long? = null protected var hashIdAcc: Long? = null + protected var overridden: List? = null protected var mask = 0L protected abstract fun accept(d: D) @@ -23,19 +24,30 @@ abstract class IdSignatureBuilder { this.classFqnSegments.clear() this.hashId = null this.mask = 0L + this.overridden = null } protected fun build(): IdSignature { val packageFqName = packageFqn.asString() val classFqName = classFqnSegments.joinToString(".") - return if (hashIdAcc == null) { - IdSignature.PublicSignature(packageFqName, classFqName, hashId, mask) - } else { - val accessorSignature = IdSignature.PublicSignature(packageFqName, classFqName, hashIdAcc, mask) - hashIdAcc = null - classFqnSegments.run { removeAt(lastIndex) } - val propertySignature = build() - IdSignature.AccessorSignature(propertySignature, accessorSignature) + return when { + overridden != null -> { + val preserved = overridden!! + overridden = null + val memberSignature = build() + val overriddenSignatures = preserved.map { buildSignature(it) } + return IdSignature.SpecialFakeOverrideSignature(memberSignature, overriddenSignatures) + } + hashIdAcc == null -> { + IdSignature.PublicSignature(packageFqName, classFqName, hashId, mask) + } + else -> { + val accessorSignature = IdSignature.PublicSignature(packageFqName, classFqName, hashIdAcc, mask) + hashIdAcc = null + classFqnSegments.run { removeAt(lastIndex) } + val propertySignature = build() + IdSignature.AccessorSignature(propertySignature, accessorSignature) + } } } diff --git a/compiler/ir/serialization.jvm/src/org/jetbrains/kotlin/backend/jvm/serialization/JvmIdSignatureDescriptor.kt b/compiler/ir/serialization.jvm/src/org/jetbrains/kotlin/backend/jvm/serialization/JvmIdSignatureDescriptor.kt index eb70b630a80..05372774c96 100644 --- a/compiler/ir/serialization.jvm/src/org/jetbrains/kotlin/backend/jvm/serialization/JvmIdSignatureDescriptor.kt +++ b/compiler/ir/serialization.jvm/src/org/jetbrains/kotlin/backend/jvm/serialization/JvmIdSignatureDescriptor.kt @@ -6,18 +6,92 @@ package org.jetbrains.kotlin.backend.jvm.serialization import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor -import org.jetbrains.kotlin.descriptors.PropertyDescriptor +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.incremental.components.NoLookupLocation import org.jetbrains.kotlin.ir.util.KotlinMangler import org.jetbrains.kotlin.load.java.descriptors.JavaForKotlinOverridePropertyDescriptor -import org.jetbrains.kotlin.load.java.descriptors.JavaPropertyDescriptor +import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe +import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeAsSequence +import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.typeUtil.contains +import org.jetbrains.kotlin.utils.addToStdlib.cast class JvmIdSignatureDescriptor(private val mangler: KotlinMangler.DescriptorMangler) : IdSignatureDescriptor(mangler) { private class JvmDescriptorBasedSignatureBuilder(mangler: KotlinMangler.DescriptorMangler) : DescriptorBasedSignatureBuilder(mangler) { + override fun platformSpecificFunction(descriptor: FunctionDescriptor) { + keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor) + } + override fun platformSpecificProperty(descriptor: PropertyDescriptor) { // See KT-31646 setSpecialJavaProperty(descriptor is JavaForKotlinOverridePropertyDescriptor) + keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor) } + + override fun platformSpecificGetter(descriptor: PropertyGetterDescriptor) { + keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor) + } + + override fun platformSpecificSetter(descriptor: PropertySetterDescriptor) { + keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor) + } + + private fun keepTrackOfOverridesForPossiblyClashingFakeOverride(descriptor: CallableMemberDescriptor) { + if (descriptor.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE) return + val containingClass = descriptor.containingDeclaration as? ClassDescriptor ?: return + + val possiblyClashingMembers = when (descriptor) { + is PropertyAccessorDescriptor -> + containingClass.unsubstitutedMemberScope + .getContributedVariables(descriptor.correspondingProperty.name, NoLookupLocation.FROM_BACKEND) + is PropertyDescriptor -> + containingClass.unsubstitutedMemberScope + .getContributedVariables(descriptor.name, NoLookupLocation.FROM_BACKEND) + is FunctionDescriptor -> + containingClass.unsubstitutedMemberScope + .getContributedFunctions(descriptor.name, NoLookupLocation.FROM_BACKEND) + else -> + throw AssertionError("Unexpected CallableMemberDescriptor: $descriptor") + } + if (possiblyClashingMembers.size <= 1) return + + val capturingOverrides = descriptor.overriddenTreeAsSequence(true).filter { + it.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE && isCapturingTypeParameter(it) + }.toList() + if (capturingOverrides.isNotEmpty()) { + overridden = capturingOverrides.sortedBy { + it.containingDeclaration.cast().fqNameUnsafe.asString() + } + } + } + + private fun isCapturingTypeParameter(member: CallableMemberDescriptor): Boolean { + val containingClasses = collectContainingClasses(member) + return member.extensionReceiverParameter?.isCapturingTypeParameter(containingClasses) == true || + member.valueParameters.any { it.isCapturingTypeParameter(containingClasses) } + } + + private fun collectContainingClasses(member: CallableMemberDescriptor): Set { + val result = HashSet() + var pointer: DeclarationDescriptor = member + while (true) { + val containingClass = pointer.containingDeclaration as? ClassDescriptor ?: break + result.add(containingClass) + if (!containingClass.isInner) break + pointer = containingClass + } + return result + } + + private fun ParameterDescriptor.isCapturingTypeParameter(containingClasses: Set): Boolean = + type.containsTypeParametersOf(containingClasses) + + private fun KotlinType.containsTypeParametersOf(containingClasses: Set): Boolean = + contains { + val descriptor = it.constructor.declarationDescriptor + descriptor is TypeParameterDescriptor && descriptor.containingDeclaration in containingClasses + } } override fun createSignatureBuilder(): DescriptorBasedSignatureBuilder = JvmDescriptorBasedSignatureBuilder(mangler) diff --git a/compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt b/compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt new file mode 100644 index 00000000000..60c64b33496 --- /dev/null +++ b/compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt @@ -0,0 +1,29 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR +// ^ TODO decide if we want to fix KT-42020 for FIR as well + +open class Base { + fun foo(x: T) = "x:$x" + fun foo(y: String) = "y:$y" +} + +open class Derived : Base() + +fun box(): String { + val b = Base() + val test1 = b.foo(x = "O") + b.foo(y = "K") + if (test1 != "x:Oy:K") + throw Exception("test1: $test1") + + val d = Derived() + val test2 = d.foo(x = "O") + d.foo(y = "K") + if (test2 != "x:Oy:K") + throw Exception("test2: $test2") + + val bd: Base = Derived() + val test4 = bd.foo(x = "O") + bd.foo(y = "K") + if (test4 != "x:Oy:K") + throw Exception("test4: $test4") + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ir/serializationRegressions/signatureClash.kt b/compiler/testData/codegen/box/ir/serializationRegressions/signatureClash.kt index 5c77a53a785..941a82ebc86 100644 --- a/compiler/testData/codegen/box/ir/serializationRegressions/signatureClash.kt +++ b/compiler/testData/codegen/box/ir/serializationRegressions/signatureClash.kt @@ -3,7 +3,6 @@ // IGNORE_BACKEND: JS // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// IGNORE_BACKEND: JVM_IR // IGNORE_BACKEND: NATIVE // IGNORE_BACKEND_FIR: JVM_IR // MODULE: lib diff --git a/compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt b/compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt new file mode 100644 index 00000000000..eb06a1ded37 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt @@ -0,0 +1,33 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// ^ TODO decide if we want to fix KT-42020 for FIR as well +// FILE: a.kt +package a + +open class Base { + fun foo(x: T) = "x:$x" + fun foo(y: String) = "y:$y" +} + +// FILE: b.kt +import a.Base + +open class Derived : Base() + +fun box(): String { + val b = Base() + val test1 = b.foo(x = "O") + b.foo(y = "K") + if (test1 != "x:Oy:K") + throw Exception("test1: $test1") + + val d = Derived() + val test2 = d.foo(x = "O") + d.foo(y = "K") + if (test2 != "x:Oy:K") + throw Exception("test2: $test2") + + val bd: Base = Derived() + val test4 = bd.foo(x = "O") + bd.foo(y = "K") + if (test4 != "x:Oy:K") + throw Exception("test4: $test4") + + return "OK" +} diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.fir.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.fir.txt new file mode 100644 index 00000000000..59492cee3a0 --- /dev/null +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.fir.txt @@ -0,0 +1,474 @@ +FILE fqName: fileName:/clashingFakeOverrideSignatures.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.Base.Base> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:T of .Base) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:x index:0 type:T of .Base + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:T of .Base) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:T of .Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' + CONST Int type=kotlin.Int value=1 + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' + CONST Int type=kotlin.Int value=2 + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived2 + CONSTRUCTOR visibility:public <> () returnType:.Derived2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Derived' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:x index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (b:.Base, d:.Derived, d2:.Derived2) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:.Base + VALUE_PARAMETER name:d index:1 type:.Derived + VALUE_PARAMETER name:d2 index:2 type:.Derived2 + BLOCK_BODY + CALL 'public final fun foo (x: T of .Base): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .Derived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .Derived' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null + y: CONST String type=kotlin.String value="" + CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseXY.BaseXY, Y of .BaseXY> + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.BaseXY.BaseXY, Y of .BaseXY> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:X of .BaseXY, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> + VALUE_PARAMETER name:x index:0 type:X of .BaseXY + VALUE_PARAMETER name:y index:1 type:kotlin.String + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:kotlin.String, y:Y of .BaseXY) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> + VALUE_PARAMETER name:x index:0 type:kotlin.String + VALUE_PARAMETER name:y index:1 type:Y of .BaseXY + BLOCK_BODY + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedXY modality:FINAL visibility:public superTypes:[.BaseXY] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DerivedXY + CONSTRUCTOR visibility:public <> () returnType:.DerivedXY [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .BaseXY' + : kotlin.String + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedXY modality:FINAL visibility:public superTypes:[.BaseXY]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:kotlin.String, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: kotlin.String, y: Y of .BaseXY): kotlin.Unit declared in .BaseXY + $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> + VALUE_PARAMETER name:x index:0 type:kotlin.String + VALUE_PARAMETER name:y index:1 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:kotlin.String, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: kotlin.String, y: Y of .BaseXY): kotlin.Unit declared in .BaseXY + $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> + VALUE_PARAMETER name:x index:0 type:kotlin.String + VALUE_PARAMETER name:y index:1 type:kotlin.String + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:outerFun visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CLASS CLASS name:LocalBase modality:OPEN visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalBase.outerFun.LocalBase> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalBase.outerFun.LocalBase> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalBase modality:OPEN visibility:local superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, x:T of .outerFun.LocalBase) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:x index:0 type:T of .outerFun.LocalBase + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:T of .outerFun.LocalBase) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:T of .outerFun.LocalBase + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outerFun.LocalBase' + CONST Int type=kotlin.Int value=1 + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outerFun.LocalBase' + CONST Int type=kotlin.Int value=2 + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:LocalDerived modality:OPEN visibility:local superTypes:[.outerFun.LocalBase] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalDerived + CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalDerived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .outerFun.LocalBase' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalDerived modality:OPEN visibility:local superTypes:[.outerFun.LocalBase]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .outerFun.LocalBase): kotlin.Unit declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:y index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:LocalDerived2 modality:FINAL visibility:local superTypes:[.outerFun.LocalDerived] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalDerived2 + CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalDerived2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .outerFun.LocalDerived' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalDerived2 modality:FINAL visibility:local superTypes:[.outerFun.LocalDerived]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .outerFun.LocalBase): kotlin.Unit declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:y index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:local modality:FINAL <> (b:.outerFun.LocalBase, d:.outerFun.LocalDerived, d2:.outerFun.LocalDerived2) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:.outerFun.LocalBase + VALUE_PARAMETER name:d index:1 type:.outerFun.LocalDerived + VALUE_PARAMETER name:d2 index:2 type:.outerFun.LocalDerived2 + BLOCK_BODY + CALL 'public final fun foo (x: T of .outerFun.LocalBase): kotlin.Unit declared in .outerFun.LocalBase' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .outerFun.LocalBase declared in .outerFun.test' type=.outerFun.LocalBase origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .outerFun.LocalBase declared in .outerFun.test' type=.outerFun.LocalBase origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .outerFun.LocalDerived declared in .outerFun.test' type=.outerFun.LocalDerived origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .outerFun.LocalDerived declared in .outerFun.test' type=.outerFun.LocalDerived origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .outerFun.LocalDerived2 declared in .outerFun.test' type=.outerFun.LocalDerived2 origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .outerFun.LocalDerived2 declared in .outerFun.test' type=.outerFun.LocalDerived2 origin=null + y: CONST String type=kotlin.String value="" + CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer> + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, x:T of .Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:x index:0 type:T of .Outer + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived + CONSTRUCTOR visibility:public <> () returnType:.OuterDerived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer]' + CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived.InnerDerived + CONSTRUCTOR visibility:public <> ($this:.OuterDerived) returnType:.OuterDerived.InnerDerived [primary] + $outer: VALUE_PARAMETER name: type:.OuterDerived + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' + $this: GET_VAR ': .OuterDerived declared in .OuterDerived' type=.OuterDerived origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:x index:0 type:kotlin.String + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt new file mode 100644 index 00000000000..bba636cd064 --- /dev/null +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt @@ -0,0 +1,67 @@ +// IGNORE_BACKEND_FIR: ANY +// ^ TODO decide if we want to fix KT-42020 for FIR as well + +open class Base { + fun foo(x: T) {} + fun foo(y: String) {} + + val T.bar get() = 1 + val String.bar get() = 2 +} + +open class Derived : Base() + +class Derived2 : Derived() + +fun test(b: Base, d: Derived, d2: Derived2) { + b.foo(x = "") + b.foo(y = "") + d.foo(x = "") + d.foo(y = "") + d2.foo(x = "") + d2.foo(y = "") +} + + +open class BaseXY { + fun foo(x: X, y: String) {} + fun foo(x: String, y: Y) {} +} + +class DerivedXY : BaseXY() + + +fun outerFun() { + open class LocalBase { + fun foo(x: T) {} + fun foo(y: String) {} + + val T.bar get() = 1 + val String.bar get() = 2 + } + + open class LocalDerived : LocalBase() + + class LocalDerived2 : LocalDerived() + + fun test(b: LocalBase, d: LocalDerived, d2: LocalDerived2) { + b.foo(x = "") + b.foo(y = "") + d.foo(x = "") + d.foo(y = "") + d2.foo(x = "") + d2.foo(y = "") + } +} + + +open class Outer { + open inner class Inner { + fun foo(x: T) {} + fun foo(y: String) {} + } +} + +class OuterDerived : Outer() { + inner class InnerDerived : Inner() +} \ No newline at end of file diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt new file mode 100644 index 00000000000..a2d4c878a57 --- /dev/null +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt.txt @@ -0,0 +1,172 @@ +open class Base { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(x: T) { + } + + fun foo(y: String) { + } + + val T.bar: Int + get(): Int { + return 1 + } + + val String.bar: Int + get(): Int { + return 2 + } + +} + +open class Derived : Base { + constructor() /* primary */ { + super/*Base*/() + /* () */ + + } + +} + +class Derived2 : Derived { + constructor() /* primary */ { + super/*Derived*/() + /* () */ + + } + +} + +fun test(b: Base, d: Derived, d2: Derived2) { + b.foo(x = "") + b.foo(y = "") + d.foo(x = "") + d.foo(y = "") + d2.foo(x = "") + d2.foo(y = "") +} + +open class BaseXY { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(x: X, y: String) { + } + + fun foo(x: String, y: Y) { + } + +} + +class DerivedXY : BaseXY { + constructor() /* primary */ { + super/*BaseXY*/() + /* () */ + + } + +} + +fun outerFun() { + local open class LocalBase { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(x: T) { + } + + fun foo(y: String) { + } + + val T.bar: Int + get(): Int { + return 1 + } + + val String.bar: Int + get(): Int { + return 2 + } + + } + + local open class LocalDerived : LocalBase { + constructor() /* primary */ { + super/*LocalBase*/() + /* () */ + + } + + } + + local class LocalDerived2 : LocalDerived { + constructor() /* primary */ { + super/*LocalDerived*/() + /* () */ + + } + + } + + local fun test(b: LocalBase, d: LocalDerived, d2: LocalDerived2) { + b.foo(x = "") + b.foo(y = "") + d.foo(x = "") + d.foo(y = "") + d2.foo(x = "") + d2.foo(y = "") + } + +} + +open class Outer { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + open inner class Inner { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + fun foo(x: T) { + } + + fun foo(y: String) { + } + + } + +} + +class OuterDerived : Outer { + constructor() /* primary */ { + super/*Outer*/() + /* () */ + + } + + inner class InnerDerived : Inner { + constructor() /* primary */ { + .super/*Inner*/() + /* () */ + + } + + } + +} diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt new file mode 100644 index 00000000000..999128f55a8 --- /dev/null +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt @@ -0,0 +1,474 @@ +FILE fqName: fileName:/clashingFakeOverrideSignatures.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base.Base> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.Base.Base> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, x:T of .Base) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:x index:0 type:T of .Base + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.Base.Base>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Base.Base> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:T of .Base) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:T of .Base + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' + CONST Int type=kotlin.Int value=1 + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.Base.Base>, $receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Base' + CONST Int type=kotlin.Int value=2 + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived + CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Base' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:OPEN visibility:public superTypes:[.Base]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .Base): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:y index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 [fake_override,operator] declared in .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived2 + CONSTRUCTOR visibility:public <> () returnType:.Derived2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Derived' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[.Derived]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Base, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit [fake_override] declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:y index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int [fake_override] declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Base, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int [fake_override] declared in .Derived + $this: VALUE_PARAMETER name: type:.Base + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 [fake_override,operator] declared in .Derived + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .Derived + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .Derived + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (b:.Base, d:.Derived, d2:.Derived2) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:.Base + VALUE_PARAMETER name:d index:1 type:.Derived + VALUE_PARAMETER name:d2 index:2 type:.Derived2 + BLOCK_BODY + CALL 'public final fun foo (x: T of .Base): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .Base declared in .test' type=.Base origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .Derived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit [fake_override] declared in .Derived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .Derived declared in .test' type=.Derived origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .Derived2' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit [fake_override] declared in .Derived2' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .Derived2 declared in .test' type=.Derived2 origin=null + y: CONST String type=kotlin.String value="" + CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BaseXY.BaseXY, Y of .BaseXY> + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:Y index:1 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.BaseXY.BaseXY, Y of .BaseXY> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseXY modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:X of .BaseXY, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> + VALUE_PARAMETER name:x index:0 type:X of .BaseXY + VALUE_PARAMETER name:y index:1 type:kotlin.String + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.BaseXY.BaseXY, Y of .BaseXY>, x:kotlin.String, y:Y of .BaseXY) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.BaseXY.BaseXY, Y of .BaseXY> + VALUE_PARAMETER name:x index:0 type:kotlin.String + VALUE_PARAMETER name:y index:1 type:Y of .BaseXY + BLOCK_BODY + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:DerivedXY modality:FINAL visibility:public superTypes:[.BaseXY] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DerivedXY + CONSTRUCTOR visibility:public <> () returnType:.DerivedXY [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .BaseXY' + : kotlin.String + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedXY modality:FINAL visibility:public superTypes:[.BaseXY]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.BaseXY, x:kotlin.String, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: X of .BaseXY, y: kotlin.String): kotlin.Unit declared in .BaseXY + $this: VALUE_PARAMETER name: type:.BaseXY + VALUE_PARAMETER name:x index:0 type:kotlin.String + VALUE_PARAMETER name:y index:1 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.BaseXY, x:kotlin.String, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: kotlin.String, y: Y of .BaseXY): kotlin.Unit declared in .BaseXY + $this: VALUE_PARAMETER name: type:.BaseXY + VALUE_PARAMETER name:x index:0 type:kotlin.String + VALUE_PARAMETER name:y index:1 type:kotlin.String + 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 [fake_override,operator] declared in .BaseXY + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .BaseXY + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .BaseXY + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:outerFun visibility:public modality:FINAL <> () returnType:kotlin.Unit + BLOCK_BODY + CLASS CLASS name:LocalBase modality:OPEN visibility:local superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalBase.outerFun.LocalBase> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalBase.outerFun.LocalBase> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalBase modality:OPEN visibility:local superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, x:T of .outerFun.LocalBase) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:x index:0 type:T of .outerFun.LocalBase + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:T of .outerFun.LocalBase) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:T of .outerFun.LocalBase + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outerFun.LocalBase' + CONST Int type=kotlin.Int value=1 + PROPERTY name:bar visibility:public modality:FINAL [val] + FUN name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase.outerFun.LocalBase>, $receiver:kotlin.String) returnType:kotlin.Int + correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase.outerFun.LocalBase> + $receiver: VALUE_PARAMETER name: type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outerFun.LocalBase' + CONST Int type=kotlin.Int value=2 + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:LocalDerived modality:OPEN visibility:local superTypes:[.outerFun.LocalBase] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalDerived + CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalDerived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .outerFun.LocalBase' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalDerived modality:OPEN visibility:local superTypes:[.outerFun.LocalBase]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .outerFun.LocalBase): kotlin.Unit declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + VALUE_PARAMETER name:y index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 [fake_override,operator] declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .outerFun.LocalBase + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:LocalDerived2 modality:FINAL visibility:local superTypes:[.outerFun.LocalDerived] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.outerFun.LocalDerived2 + CONSTRUCTOR visibility:public <> () returnType:.outerFun.LocalDerived2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .outerFun.LocalDerived' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LocalDerived2 modality:FINAL visibility:local superTypes:[.outerFun.LocalDerived]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + VALUE_PARAMETER name:y index:0 type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int [fake_override] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.outerFun.LocalBase, $receiver:kotlin.String) returnType:kotlin.Int [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:FINAL [fake_override,val] + overridden: + public final fun (): kotlin.Int [fake_override] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:.outerFun.LocalBase + $receiver: VALUE_PARAMETER name: type:kotlin.String + 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 [fake_override,operator] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .outerFun.LocalDerived + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:local modality:FINAL <> (b:.outerFun.LocalBase, d:.outerFun.LocalDerived, d2:.outerFun.LocalDerived2) returnType:kotlin.Unit + VALUE_PARAMETER name:b index:0 type:.outerFun.LocalBase + VALUE_PARAMETER name:d index:1 type:.outerFun.LocalDerived + VALUE_PARAMETER name:d2 index:2 type:.outerFun.LocalDerived2 + BLOCK_BODY + CALL 'public final fun foo (x: T of .outerFun.LocalBase): kotlin.Unit declared in .outerFun.LocalBase' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .outerFun.LocalBase declared in .outerFun.test' type=.outerFun.LocalBase origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit declared in .outerFun.LocalBase' type=kotlin.Unit origin=null + $this: GET_VAR 'b: .outerFun.LocalBase declared in .outerFun.test' type=.outerFun.LocalBase origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .outerFun.LocalDerived declared in .outerFun.test' type=.outerFun.LocalDerived origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived' type=kotlin.Unit origin=null + $this: GET_VAR 'd: .outerFun.LocalDerived declared in .outerFun.test' type=.outerFun.LocalDerived origin=null + y: CONST String type=kotlin.String value="" + CALL 'public final fun foo (x: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived2' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .outerFun.LocalDerived2 declared in .outerFun.test' type=.outerFun.LocalDerived2 origin=null + x: CONST String type=kotlin.String value="" + CALL 'public final fun foo (y: kotlin.String): kotlin.Unit [fake_override] declared in .outerFun.LocalDerived2' type=kotlin.Unit origin=null + $this: GET_VAR 'd2: .outerFun.LocalDerived2 declared in .outerFun.test' type=.outerFun.LocalDerived2 origin=null + y: CONST String type=kotlin.String value="" + CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Outer> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> () returnType:.Outer.Outer> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Outer modality:OPEN visibility:public superTypes:[kotlin.Any]' + CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Outer> + CONSTRUCTOR visibility:public <> ($this:.Outer.Outer>) returnType:.Outer.Inner.Outer> [primary] + $outer: VALUE_PARAMETER name: type:.Outer.Outer> + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:OPEN visibility:public [inner] superTypes:[kotlin.Any]' + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, x:T of .Outer) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:x index:0 type:T of .Outer + BLOCK_BODY + FUN name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner.Outer>, y:kotlin.String) returnType:kotlin.Unit + $this: VALUE_PARAMETER name: type:.Outer.Inner.Outer> + VALUE_PARAMETER name:y index:0 type:kotlin.String + BLOCK_BODY + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived + CONSTRUCTOR visibility:public <> () returnType:.OuterDerived [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer' + : kotlin.String + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:OuterDerived modality:FINAL visibility:public superTypes:[.Outer]' + CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.OuterDerived.InnerDerived + CONSTRUCTOR visibility:public <> ($this:.OuterDerived) returnType:.OuterDerived.InnerDerived [primary] + $outer: VALUE_PARAMETER name: type:.OuterDerived + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer.Inner' + $this: GET_VAR ': .OuterDerived declared in .OuterDerived.InnerDerived.' type=.OuterDerived origin=null + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InnerDerived modality:FINAL visibility:public [inner] superTypes:[.Outer.Inner]' + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, x:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (x: T of .Outer): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner + VALUE_PARAMETER name:x index:0 type:kotlin.String + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:.Outer.Inner, y:kotlin.String) returnType:kotlin.Unit [fake_override] + overridden: + public final fun foo (y: kotlin.String): kotlin.Unit declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:.Outer.Inner + VALUE_PARAMETER name:y index:0 type:kotlin.String + 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 [fake_override,operator] declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .Outer.Inner + $this: VALUE_PARAMETER name: type:kotlin.Any + 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 [fake_override,operator] declared in .Outer + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int [fake_override] declared in .Outer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String [fake_override] declared in .Outer + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt index cc7d7857c25..8c13fecda66 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/ir/AbstractIrGeneratorTestCase.kt @@ -19,14 +19,19 @@ package org.jetbrains.kotlin.ir import org.jetbrains.kotlin.analyzer.AnalysisResult import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor import org.jetbrains.kotlin.backend.jvm.JvmGeneratorExtensions +import org.jetbrains.kotlin.backend.jvm.serialization.JvmIdSignatureDescriptor import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.codegen.CodegenTestCase +import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.config.languageVersionSettings +import org.jetbrains.kotlin.idea.MainFunctionDetector import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerDesc +import org.jetbrains.kotlin.ir.backend.jvm.serialization.JvmManglerDesc import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.declarations.IrModuleFragment import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl +import org.jetbrains.kotlin.ir.util.IdSignatureComposer import org.jetbrains.kotlin.ir.util.NameProvider import org.jetbrains.kotlin.ir.util.SymbolTable import org.jetbrains.kotlin.ir.util.generateTypicalIrProviderList @@ -36,11 +41,11 @@ import org.jetbrains.kotlin.psi2ir.Psi2IrConfiguration import org.jetbrains.kotlin.psi2ir.Psi2IrTranslator import org.jetbrains.kotlin.psi2ir.generators.GeneratorExtensions import org.jetbrains.kotlin.resolve.AnalyzingUtils +import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.test.KotlinTestUtils.getAnnotationsJar -import org.jetbrains.kotlin.test.TargetBackend import java.io.File import java.util.* @@ -95,7 +100,12 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() { } protected open fun doGenerateIrModule(psi2IrTranslator: Psi2IrTranslator): IrModuleFragment = - generateIrModuleWithJvmResolve(myFiles.psiFiles, myEnvironment, psi2IrTranslator) + generateIrModuleWithJvmResolve( + myFiles.psiFiles, + myEnvironment, + psi2IrTranslator, + myEnvironment.configuration.languageVersionSettings + ) protected fun generateIrFilesAsSingleModule(testFiles: List, ignoreErrors: Boolean = false): Map { val irModule = generateIrModule(ignoreErrors) @@ -118,22 +128,31 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() { moduleDescriptors = emptyList(), friendModuleDescriptors = emptyList() ), - psi2ir, ktFilesToAnalyze, GeneratorExtensions() + psi2ir, ktFilesToAnalyze, GeneratorExtensions(), + createIdSignatureComposer = { IdSignatureDescriptor(JsManglerDesc) } ) fun generateIrModuleWithJvmResolve( - ktFilesToAnalyze: List, environment: KotlinCoreEnvironment, psi2ir: Psi2IrTranslator - ): IrModuleFragment = - generateIrModule( + ktFilesToAnalyze: List, + environment: KotlinCoreEnvironment, + psi2ir: Psi2IrTranslator, + languageVersionSettings: LanguageVersionSettings + ): IrModuleFragment { + return generateIrModule( JvmResolveUtil.analyze(ktFilesToAnalyze, environment), psi2ir, ktFilesToAnalyze, - JvmGeneratorExtensions(generateFacades = false) + JvmGeneratorExtensions(generateFacades = false), + createIdSignatureComposer = { bindingContext -> + JvmIdSignatureDescriptor(JvmManglerDesc(MainFunctionDetector(bindingContext, languageVersionSettings))) + } ) + } private fun generateIrModule( analysisResult: AnalysisResult, psi2ir: Psi2IrTranslator, ktFilesToAnalyze: List, - generatorExtensions: GeneratorExtensions + generatorExtensions: GeneratorExtensions, + createIdSignatureComposer: (BindingContext) -> IdSignatureComposer ): IrModuleFragment { val (bindingContext, moduleDescriptor) = analysisResult if (!psi2ir.configuration.ignoreErrors) { @@ -143,7 +162,8 @@ abstract class AbstractIrGeneratorTestCase : CodegenTestCase() { val context = psi2ir.createGeneratorContext( moduleDescriptor, bindingContext, - SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl, NameProvider.DEFAULT), + // SymbolTable(IdSignatureDescriptor(JsManglerDesc), IrFactoryImpl, NameProvider.DEFAULT), + SymbolTable(createIdSignatureComposer(bindingContext), IrFactoryImpl, NameProvider.DEFAULT), generatorExtensions ) val irProviders = generateTypicalIrProviderList( diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 491fd945ca5..89a1e8aa068 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -15937,6 +15937,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/ir/anonymousObjectInsideElvis.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInitializers.kt") public void testClassInitializers() throws Exception { runTest("compiler/testData/codegen/box/ir/classInitializers.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index 768154b00c0..742bc9735a6 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -53,6 +53,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInObject.kt") public void testClassInObject() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/classInObject.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 3bf118dd06e..cfc78f96461 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -15937,6 +15937,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/ir/anonymousObjectInsideElvis.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInitializers.kt") public void testClassInitializers() throws Exception { runTest("compiler/testData/codegen/box/ir/classInitializers.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index ed92c4b4efc..ec2168073e4 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -15937,6 +15937,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/ir/anonymousObjectInsideElvis.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/codegen/box/ir/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInitializers.kt") public void testClassInitializers() throws Exception { runTest("compiler/testData/codegen/box/ir/classInitializers.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index 661e383ed48..b3b619d0713 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -54,6 +54,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInObject.kt") public void testClassInObject() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/classInObject.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java index 2bf647867d7..5005fea3504 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java @@ -54,6 +54,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInObject.kt") public void testClassInObject() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/classInObject.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java index b9e522e054a..4d326471d3c 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java @@ -54,6 +54,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classInObject.kt") public void testClassInObject() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/classInObject.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index a6d46b7c275..f90fb2e507a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -55,6 +55,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { runTest("compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.kt"); } + @TestMetadata("clashingFakeOverrideSignatures.kt") + public void testClashingFakeOverrideSignatures() throws Exception { + runTest("compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.kt"); + } + @TestMetadata("classMembers.kt") public void testClassMembers() throws Exception { runTest("compiler/testData/ir/irText/classes/classMembers.kt");