diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java index ee85ba3b713..a9abe375f87 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java @@ -134,7 +134,7 @@ public class ConstructorCodegen { ConstructorContext constructorContext = context.intoConstructor(constructorDescriptor, typeMapper); functionCodegen.generateMethod( - JvmDeclarationOriginKt.OtherOrigin(constructor, constructorDescriptor), + JvmDeclarationOriginKt.OtherOrigin(constructorDescriptor), constructorDescriptor, constructorContext, new FunctionGenerationStrategy.CodegenBased(state) { @Override diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt index adaec315cce..01da0071b09 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/JvmDeclarationOrigin.kt @@ -59,7 +59,8 @@ fun OtherOrigin(element: PsiElement?, descriptor: DeclarationDescriptor? = null) fun OtherOriginFromPure(element: KtPureElement?, descriptor: DeclarationDescriptor? = null) = OtherOrigin(element?.psiOrParent, descriptor) -fun OtherOrigin(descriptor: DeclarationDescriptor) = JvmDeclarationOrigin(OTHER, null, descriptor) +fun OtherOrigin(descriptor: DeclarationDescriptor): JvmDeclarationOrigin = + JvmDeclarationOrigin(OTHER, DescriptorToSourceUtils.descriptorToDeclaration(descriptor), descriptor) fun Bridge( descriptor: DeclarationDescriptor, diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt index e0e89bbcc2d..9e7daee7747 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ClassCodegen.kt @@ -365,11 +365,8 @@ private val Modality.flags: Int private val Visibility.flags: Int get() = AsmUtil.getVisibilityAccessFlag(this) ?: throw AssertionError("Unsupported visibility $this") -private val IrField.OtherOrigin: JvmDeclarationOrigin - get() = OtherOrigin(descriptor.psiElement, this.descriptor) - -internal val IrFunction.OtherOrigin: JvmDeclarationOrigin - get() = OtherOrigin(descriptor.psiElement, this.descriptor) +internal val IrDeclaration.OtherOrigin: JvmDeclarationOrigin + get() = OtherOrigin(descriptor) private fun IrClass.getSuperClassInfo(typeMapper: IrTypeMapper): IrSuperClassInfo { if (isInterface) { @@ -384,4 +381,4 @@ private fun IrClass.getSuperClassInfo(typeMapper: IrTypeMapper): IrSuperClassInf } return IrSuperClassInfo(AsmTypes.OBJECT_TYPE, null) -} \ No newline at end of file +}