Minor, use Annotations.EMPTY instead of empty AnnotationsImpl
This commit is contained in:
+4
-4
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.codegen.AsmUtil
|
|||||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationsImpl
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||||
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
|
||||||
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||||
@@ -105,20 +105,20 @@ internal fun createStaticFunctionWithReceivers(
|
|||||||
): SimpleFunctionDescriptorImpl {
|
): SimpleFunctionDescriptorImpl {
|
||||||
val newFunction = SimpleFunctionDescriptorImpl.create(
|
val newFunction = SimpleFunctionDescriptorImpl.create(
|
||||||
owner,
|
owner,
|
||||||
AnnotationsImpl(emptyList()),
|
Annotations.EMPTY,
|
||||||
name,
|
name,
|
||||||
CallableMemberDescriptor.Kind.DECLARATION, descriptor.source
|
CallableMemberDescriptor.Kind.DECLARATION, descriptor.source
|
||||||
)
|
)
|
||||||
var offset = 0
|
var offset = 0
|
||||||
val dispatchReceiver =
|
val dispatchReceiver =
|
||||||
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
||||||
newFunction, null, offset++, AnnotationsImpl(emptyList()), Name.identifier("this"),
|
newFunction, null, offset++, Annotations.EMPTY, Name.identifier("this"),
|
||||||
dispatchReceiverType, false, false, false, null, descriptor.source, null
|
dispatchReceiverType, false, false, false, null, descriptor.source, null
|
||||||
)
|
)
|
||||||
val extensionReceiver =
|
val extensionReceiver =
|
||||||
descriptor.extensionReceiverParameter?.let { extensionReceiver ->
|
descriptor.extensionReceiverParameter?.let { extensionReceiver ->
|
||||||
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
||||||
newFunction, null, offset++, AnnotationsImpl(emptyList()), Name.identifier("receiver"),
|
newFunction, null, offset++, Annotations.EMPTY, Name.identifier("receiver"),
|
||||||
extensionReceiver.value.type, false, false, false, null, extensionReceiver.source, null
|
extensionReceiver.value.type, false, false, false, null, extensionReceiver.source, null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.backend.jvm.lower
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.backend.common.lower.InitializersLowering
|
import org.jetbrains.kotlin.backend.common.lower.InitializersLowering
|
||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationsImpl
|
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||||
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
|
||||||
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
|
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
@@ -29,7 +29,7 @@ fun FunctionDescriptor.toStatic(
|
|||||||
dispatchReceiverClass: ClassDescriptor? = this.containingDeclaration as? ClassDescriptor
|
dispatchReceiverClass: ClassDescriptor? = this.containingDeclaration as? ClassDescriptor
|
||||||
): FunctionDescriptor {
|
): FunctionDescriptor {
|
||||||
val newFunction = SimpleFunctionDescriptorImpl.create(
|
val newFunction = SimpleFunctionDescriptorImpl.create(
|
||||||
newOwner, AnnotationsImpl(emptyList()),
|
newOwner, Annotations.EMPTY,
|
||||||
name,
|
name,
|
||||||
CallableMemberDescriptor.Kind.DECLARATION, this.source
|
CallableMemberDescriptor.Kind.DECLARATION, this.source
|
||||||
)
|
)
|
||||||
@@ -37,14 +37,14 @@ fun FunctionDescriptor.toStatic(
|
|||||||
var offset = 0
|
var offset = 0
|
||||||
val dispatchReceiver = dispatchReceiverParameter?.let {
|
val dispatchReceiver = dispatchReceiverParameter?.let {
|
||||||
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
||||||
newFunction, null, offset++, AnnotationsImpl(emptyList()), Name.identifier("this"),
|
newFunction, null, offset++, Annotations.EMPTY, Name.identifier("this"),
|
||||||
dispatchReceiverClass!!.defaultType, false, false, false, null, dispatchReceiverClass.source, null
|
dispatchReceiverClass!!.defaultType, false, false, false, null, dispatchReceiverClass.source, null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val extensionReceiver = extensionReceiverParameter?.let {
|
val extensionReceiver = extensionReceiverParameter?.let {
|
||||||
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
ValueParameterDescriptorImpl.createWithDestructuringDeclarations(
|
||||||
newFunction, null, offset++, AnnotationsImpl(emptyList()), Name.identifier("receiver"),
|
newFunction, null, offset++, Annotations.EMPTY, Name.identifier("receiver"),
|
||||||
it.value.type, false, false, false, null, it.source, null
|
it.value.type, false, false, false, null, it.source, null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user