Try loading PSI from descriptor in OtherOrigin constructor
To simplify several call sites
This commit is contained in:
@@ -134,7 +134,7 @@ public class ConstructorCodegen {
|
|||||||
ConstructorContext constructorContext = context.intoConstructor(constructorDescriptor, typeMapper);
|
ConstructorContext constructorContext = context.intoConstructor(constructorDescriptor, typeMapper);
|
||||||
|
|
||||||
functionCodegen.generateMethod(
|
functionCodegen.generateMethod(
|
||||||
JvmDeclarationOriginKt.OtherOrigin(constructor, constructorDescriptor),
|
JvmDeclarationOriginKt.OtherOrigin(constructorDescriptor),
|
||||||
constructorDescriptor, constructorContext,
|
constructorDescriptor, constructorContext,
|
||||||
new FunctionGenerationStrategy.CodegenBased(state) {
|
new FunctionGenerationStrategy.CodegenBased(state) {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-1
@@ -59,7 +59,8 @@ fun OtherOrigin(element: PsiElement?, descriptor: DeclarationDescriptor? = null)
|
|||||||
fun OtherOriginFromPure(element: KtPureElement?, descriptor: DeclarationDescriptor? = null) =
|
fun OtherOriginFromPure(element: KtPureElement?, descriptor: DeclarationDescriptor? = null) =
|
||||||
OtherOrigin(element?.psiOrParent, descriptor)
|
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(
|
fun Bridge(
|
||||||
descriptor: DeclarationDescriptor,
|
descriptor: DeclarationDescriptor,
|
||||||
|
|||||||
+2
-5
@@ -365,11 +365,8 @@ private val Modality.flags: Int
|
|||||||
private val Visibility.flags: Int
|
private val Visibility.flags: Int
|
||||||
get() = AsmUtil.getVisibilityAccessFlag(this) ?: throw AssertionError("Unsupported visibility $this")
|
get() = AsmUtil.getVisibilityAccessFlag(this) ?: throw AssertionError("Unsupported visibility $this")
|
||||||
|
|
||||||
private val IrField.OtherOrigin: JvmDeclarationOrigin
|
internal val IrDeclaration.OtherOrigin: JvmDeclarationOrigin
|
||||||
get() = OtherOrigin(descriptor.psiElement, this.descriptor)
|
get() = OtherOrigin(descriptor)
|
||||||
|
|
||||||
internal val IrFunction.OtherOrigin: JvmDeclarationOrigin
|
|
||||||
get() = OtherOrigin(descriptor.psiElement, this.descriptor)
|
|
||||||
|
|
||||||
private fun IrClass.getSuperClassInfo(typeMapper: IrTypeMapper): IrSuperClassInfo {
|
private fun IrClass.getSuperClassInfo(typeMapper: IrTypeMapper): IrSuperClassInfo {
|
||||||
if (isInterface) {
|
if (isInterface) {
|
||||||
|
|||||||
Reference in New Issue
Block a user