diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index c244554c193..34585328f0e 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -6,7 +6,6 @@ package org.jetbrains.kotlin.fir.backend.generators import org.jetbrains.kotlin.KtFakeSourceElementKind -import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.backend.* import org.jetbrains.kotlin.fir.declarations.* @@ -21,7 +20,6 @@ import org.jetbrains.kotlin.fir.references.FirSuperReference import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference import org.jetbrains.kotlin.fir.references.impl.FirReferencePlaceholderForResolvedAnnotations import org.jetbrains.kotlin.fir.resolve.calls.FirSyntheticFunctionSymbol -import org.jetbrains.kotlin.fir.resolve.dfa.unwrapSmartcastExpression import org.jetbrains.kotlin.fir.resolve.fullyExpandedType import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutorByMap @@ -39,7 +37,10 @@ import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl import org.jetbrains.kotlin.ir.types.* -import org.jetbrains.kotlin.ir.util.* +import org.jetbrains.kotlin.ir.util.dump +import org.jetbrains.kotlin.ir.util.isFunctionTypeOrSubtype +import org.jetbrains.kotlin.ir.util.isInterface +import org.jetbrains.kotlin.ir.util.isMethodOfAny import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi2ir.generators.hasNoSideEffects import org.jetbrains.kotlin.psi2ir.generators.isUnchanging @@ -253,30 +254,6 @@ class CallAndReferenceGenerator( return null } - // Note: I don't like using super qualifier symbols to determine field receivers in bytecode properly. - // Would be much better to use super qualifiers only in case when it's used explicitly. - // However, FE 1.0 does it, and currently we have no better way to provide these receivers. - // See KT-49507 and KT-48954 as good examples for cases we try to handle here - private fun FirExpression.superQualifierSymbolForField(fieldSymbol: IrFieldSymbol): IrClassSymbol? { - val unwrapped = this.unwrapSmartcastExpression() - if (unwrapped !is FirQualifiedAccess) return null - if (unwrapped.calleeReference is FirSuperReference) return superQualifierSymbol() - if (fieldSymbol.owner.correspondingPropertySymbol != null) return null - val originalContainingClass = fieldSymbol.owner.parentClassOrNull ?: return null - val ownContainingClass = typeRef.toIrType().classifierOrNull?.owner as? IrClass ?: return null - // For static field, we shouldn't unwrap fake override in any case - if (fieldSymbol.owner.isStatic) return ownContainingClass.symbol - // Find first Java super class to avoid possible visibility exposure & separate compilation problems - var superQualifierClass = ownContainingClass - while (!superQualifierClass.isFromJava() && superQualifierClass !== originalContainingClass) { - superQualifierClass = superQualifierClass.superTypes.find { - val kind = it.getClass()?.kind - kind == ClassKind.CLASS || kind == ClassKind.ENUM_CLASS - }?.getClass() ?: break - } - return superQualifierClass.symbol - } - private fun FirExpression.superQualifierSymbol(): IrClassSymbol? { if (this !is FirQualifiedAccess) { return null @@ -492,7 +469,7 @@ class CallAndReferenceGenerator( IrGetFieldImpl( startOffset, endOffset, symbol, type, origin = IrStatementOrigin.GET_PROPERTY.takeIf { calleeReference !is FirDelegateFieldReference }, - superQualifierSymbol = dispatchReceiver.superQualifierSymbolForField(symbol) + superQualifierSymbol = dispatchReceiver.superQualifierSymbol() ) } is IrValueSymbol -> { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index aa204b1a2f8..9dc0d05f4fe 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -17801,6 +17801,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/fieldRename/javaFieldAndCompanionProperty.kt"); } + @Test + @TestMetadata("javaFieldAndKotlinPrivateProperty.kt") + public void testJavaFieldAndKotlinPrivateProperty() throws Exception { + runTest("compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinPrivateProperty.kt"); + } + @Test @TestMetadata("javaFieldAndKotlinProperty.kt") public void testJavaFieldAndKotlinProperty() throws Exception { diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt index 49c7598d165..bb2353dbdbf 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/CallGenerator.kt @@ -19,7 +19,6 @@ package org.jetbrains.kotlin.psi2ir.generators import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor import org.jetbrains.kotlin.descriptors.impl.SyntheticFieldDescriptor -import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB import org.jetbrains.kotlin.ir.declarations.IrVariable import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* @@ -37,7 +36,6 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument import org.jetbrains.kotlin.resolve.calls.tasks.isDynamic import org.jetbrains.kotlin.resolve.calls.util.FakeCallableDescriptorForObject import org.jetbrains.kotlin.resolve.descriptorUtil.classValueType -import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny import org.jetbrains.kotlin.types.KotlinType class CallGenerator(statementGenerator: StatementGenerator) : StatementGeneratorExtension(statementGenerator) { @@ -195,21 +193,6 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator } } - private fun PropertyDescriptor.containingClassForField(): ClassDescriptor? { - val ownContainingClass = containingDeclaration as? ClassDescriptor ?: return null - // For static field, we shouldn't unwrap fake override in any case - if (dispatchReceiverParameter == null) return ownContainingClass - val originalContainingClass = resolveFakeOverride().containingDeclaration as? ClassDescriptor ?: return ownContainingClass - // Find first Java super class to avoid possible visibility exposure & separate compilation problems - var containingClassForField = ownContainingClass - while (context.extensions.computeExternalDeclarationOrigin(containingClassForField) != IR_EXTERNAL_JAVA_DECLARATION_STUB && - containingClassForField !== originalContainingClass - ) { - containingClassForField = containingClassForField.getSuperClassNotAny() ?: break - } - return containingClassForField - } - private fun generatePropertyGetterCall( descriptor: PropertyDescriptor, startOffset: Int, @@ -220,11 +203,10 @@ class CallGenerator(statementGenerator: StatementGenerator) : StatementGenerator val irType = descriptor.type.toIrType() return if (getMethodDescriptor == null) { - val superQualifierSymbol = - (call.superQualifier ?: descriptor.containingClassForField())?.let { - if (it is ScriptDescriptor) null // otherwise it creates a reference to script as class; TODO: check if correct - else context.symbolTable.referenceClass(it) - } + val superQualifierSymbol = (call.superQualifier ?: descriptor.containingDeclaration as? ClassDescriptor)?.let { + if (it is ScriptDescriptor) null // otherwise it creates a reference to script as class; TODO: check if correct + else context.symbolTable.referenceClass(it) + } val fieldSymbol = context.symbolTable.referenceField(context.extensions.remapDebuggerFieldPropertyDescriptor(descriptor.resolveFakeOverride().original)) call.callReceiver.call { dispatchReceiverValue, extensionReceiverValue, _ -> diff --git a/compiler/testData/codegen/box/fieldRename/javaFieldAndCompanionProperty.kt b/compiler/testData/codegen/box/fieldRename/javaFieldAndCompanionProperty.kt index 92e95b0bb62..b1261613250 100644 --- a/compiler/testData/codegen/box/fieldRename/javaFieldAndCompanionProperty.kt +++ b/compiler/testData/codegen/box/fieldRename/javaFieldAndCompanionProperty.kt @@ -1,4 +1,7 @@ // TARGET_BACKEND: JVM_IR +// IGNORE_BACKEND: JVM_IR +// IGNORE_BACKEND_FIR: JVM_IR +// FIR_STATUS: accesses companion property backing field statically and fails (does not work in K1/JVM too) // FILE: Base.java public class Base { diff --git a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinPrivateProperty.kt b/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinPrivateProperty.kt new file mode 100644 index 00000000000..95c432f677d --- /dev/null +++ b/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinPrivateProperty.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM_IR +// Note: works accidentally via backing field access +// Field VS property: case 4.2 +// More or less duplicates the case in KT-34943/KT-54393 + +// FILE: BaseJava.java +public class BaseJava { + public String a = "FAIL"; +} + +// FILE: Derived.kt +class Derived : BaseJava() { + private val a = "OK" + + fun x() = a +} + +fun box() = Derived().x() diff --git a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.fir.ir.txt b/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.fir.ir.txt deleted file mode 100644 index 46767087de5..00000000000 --- a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.fir.ir.txt +++ /dev/null @@ -1,36 +0,0 @@ -FILE fqName: fileName:/Derived.kt - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .BaseJava' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava]' - PROPERTY name:a visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="FAIL" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.String - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Derived - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Derived' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null - 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 .BaseJava - $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 .BaseJava - $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 .BaseJava - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:box visibility:public modality:FINAL <> () returnType:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): @[FlexibleNullability] kotlin.String? declared in ' - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] kotlin.String? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY - receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Derived' type=.Derived origin=null diff --git a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.ir.txt b/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.ir.txt deleted file mode 100644 index bee2c059f2f..00000000000 --- a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.ir.txt +++ /dev/null @@ -1,39 +0,0 @@ -FILE fqName: fileName:/Derived.kt - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .BaseJava' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.BaseJava]' - PROPERTY name:a visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="FAIL" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.String - correspondingProperty: PROPERTY name:a visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Derived - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Derived' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:a type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .Derived declared in .Derived.' type=.Derived origin=null - PROPERTY FAKE_OVERRIDE name:a visibility:public modality:FINAL [fake_override,var] - overridden: - public final a: @[FlexibleNullability] kotlin.String? [var] - 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 .BaseJava - $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 .BaseJava - $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 .BaseJava - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:box visibility:public modality:FINAL <> () returnType:@[FlexibleNullability] kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): @[FlexibleNullability] kotlin.String? declared in ' - GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:a type:@[FlexibleNullability] kotlin.String? visibility:public' type=@[FlexibleNullability] kotlin.String? origin=GET_PROPERTY - receiver: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Derived' type=.Derived origin=null diff --git a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.kt b/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.kt index 6eac6bc4cc4..645cbbd93b0 100644 --- a/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.kt +++ b/compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinProperty.kt @@ -1,5 +1,9 @@ // TARGET_BACKEND: JVM_IR -// DUMP_IR +// IGNORE_BACKEND: JVM_IR +// IGNORE_BACKEND_FIR: JVM_IR +// FIR_STATUS: accesses property backing field accidentally and fails with exception (does not work in K1/JVM too) +// Field VS property: case 4.1 +// See KT-54393 for details // FILE: BaseJava.java public class BaseJava { diff --git a/compiler/testData/codegen/bytecodeText/javaFields.kt b/compiler/testData/codegen/bytecodeText/javaFields.kt index cbb3edc9236..a3afb7bb6ff 100644 --- a/compiler/testData/codegen/bytecodeText/javaFields.kt +++ b/compiler/testData/codegen/bytecodeText/javaFields.kt @@ -16,18 +16,8 @@ open class Kotlin2 : Java2() { fun test1(j: Kotlin2) = j.f -// JVM_IR_TEMPLATES -// @Kotlin2.class: -// 2 GETFIELD Java2.f : I - -// JVM_IR_TEMPLATES -// @TestKt.class: -// 2 GETFIELD Java2.f : I - -// JVM_TEMPLATES // @Kotlin2.class: // 1 GETFIELD Java2.f : I -// JVM_TEMPLATES // @TestKt.class: -// 1 GETFIELD Java2.f : I \ No newline at end of file +// 1 GETFIELD Kotlin2.f : I \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt b/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt index ac29c48c02b..93bcb38f0f4 100644 --- a/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt +++ b/compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt @@ -31,13 +31,7 @@ fun test(b : Boolean) { } // @TestKt.class: -// 1 PUTFIELD JFieldOwner.f : I -// 1 PUTFIELD Mid.f : I - -// JVM_IR_TEMPLATES -// 2 GETFIELD JFieldOwner.f : I -// 0 GETFIELD Mid.f : I - -// JVM_TEMPLATES // 1 GETFIELD JFieldOwner.f : I +// 1 PUTFIELD JFieldOwner.f : I // 1 GETFIELD Mid.f : I +// 1 PUTFIELD Mid.f : I diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt index 2643c433634..bbc78289153 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.fir.kt.txt @@ -13,14 +13,14 @@ class C : B { fun f(): @FlexibleNullability String? { return eval<@FlexibleNullability String?>(f = local fun (): @FlexibleNullability String? { - return (super).#x + return .#x } ) } fun g(): @FlexibleNullability String? { return eval<@FlexibleNullability String?>(f = local fun (): @FlexibleNullability String? { - return (super).#y + return .#y } ) } diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt index 2643c433634..9ca60a6ecd9 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt.txt @@ -13,14 +13,14 @@ class C : B { fun f(): @FlexibleNullability String? { return eval<@FlexibleNullability String?>(f = local fun (): @FlexibleNullability String? { - return (super).#x + return (super).#x } ) } fun g(): @FlexibleNullability String? { return eval<@FlexibleNullability String?>(f = local fun (): @FlexibleNullability String? { - return (super).#y + return (super).#y } ) } diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt index 941453d1e97..ff523dae206 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.fir.kt.txt @@ -55,7 +55,7 @@ fun test(b: Boolean) { else -> d2 } k.#f = 42 - k(super).#f /*~> Unit */ + k.#f /*~> Unit */ val md1: DerivedThroughMid1 = DerivedThroughMid1() val md2: DerivedThroughMid2 = DerivedThroughMid2() val mk: Mid = when { @@ -63,6 +63,6 @@ fun test(b: Boolean) { else -> md2 } mk.#f = 44 - mk(super).#f /*~> Unit */ + mk.#f /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt index 9829e9751d1..37ac60fbc45 100644 --- a/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmFieldReferenceWithIntersectionTypes.kt.txt @@ -63,6 +63,6 @@ fun test(b: Boolean) { else -> md2 } mk /*as Mid */(super).#f = 44 - mk /*as Mid */(super).#f /*~> Unit */ + mk /*as Mid */(super).#f /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt index bdc1eb9fde0..b8d23df3e1f 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.fir.kt.txt @@ -10,7 +10,7 @@ class Derived : Base { } fun getValue(): Int { - return (super).#value + return .#value } fun setValue(value: Int) { diff --git a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt index 564bed8bbb1..0a51e83f756 100644 --- a/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt +++ b/compiler/testData/ir/irText/expressions/jvmInstanceFieldReference.kt.txt @@ -10,7 +10,7 @@ class Derived : Base { } fun getValue(): Int { - return (super).#value + return (super).#value } fun setValue(value: Int) { diff --git a/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt b/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt index 8c3a96b9921..1170e902447 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/OutBox.fir.kt.txt @@ -13,7 +13,7 @@ class Box { get(): String { var foo: Foo = .() when { - foo is Buz -> return foo /*as Buz */(super).#str /*!! String */ + foo is Buz -> return foo /*as Buz */.#str /*!! String */ } return "" } diff --git a/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.fir.kt.txt b/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.fir.kt.txt index 72870f565ad..9575285c281 100644 --- a/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/typeParameterFromJavaClass.fir.kt.txt @@ -1,6 +1,6 @@ fun foo(movedPaths: MutableList>) { movedPaths.forEach>(action = local fun (it: Couple) { - it(super).#second.getName() /*~> Unit */ + it.#second.getName() /*~> Unit */ } ) } diff --git a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt index 5bf439cb437..5cff33b63be 100644 --- a/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/smartCastOnFieldReceiverOfGenericType.fir.kt.txt @@ -6,6 +6,6 @@ fun testSetField(a: Any, b: Any) { fun testGetField(a: Any): String { a as JCell /*~> Unit */ - return a /*as JCell */(super).#value /*!! String */ + return a /*as JCell */.#value /*!! String */ } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 68e1c31dc4a..68a1a321b78 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -17801,6 +17801,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/fieldRename/javaFieldAndCompanionProperty.kt"); } + @Test + @TestMetadata("javaFieldAndKotlinPrivateProperty.kt") + public void testJavaFieldAndKotlinPrivateProperty() throws Exception { + runTest("compiler/testData/codegen/box/fieldRename/javaFieldAndKotlinPrivateProperty.kt"); + } + @Test @TestMetadata("javaFieldAndKotlinProperty.kt") public void testJavaFieldAndKotlinProperty() throws Exception {