Minor, use Annotations.EMPTY instead of empty AnnotationsImpl

This commit is contained in:
Alexander Udalov
2018-08-22 17:39:27 +02:00
parent 872f6e2cea
commit 8d44824875
2 changed files with 8 additions and 8 deletions
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
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.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.ir.declarations.IrClass
@@ -105,20 +105,20 @@ internal fun createStaticFunctionWithReceivers(
): SimpleFunctionDescriptorImpl {
val newFunction = SimpleFunctionDescriptorImpl.create(
owner,
AnnotationsImpl(emptyList()),
Annotations.EMPTY,
name,
CallableMemberDescriptor.Kind.DECLARATION, descriptor.source
)
var offset = 0
val dispatchReceiver =
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
)
val extensionReceiver =
descriptor.extensionReceiverParameter?.let { extensionReceiver ->
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
)
}
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.backend.jvm.lower
import org.jetbrains.kotlin.backend.common.lower.InitializersLowering
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.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.name.Name
@@ -29,7 +29,7 @@ fun FunctionDescriptor.toStatic(
dispatchReceiverClass: ClassDescriptor? = this.containingDeclaration as? ClassDescriptor
): FunctionDescriptor {
val newFunction = SimpleFunctionDescriptorImpl.create(
newOwner, AnnotationsImpl(emptyList()),
newOwner, Annotations.EMPTY,
name,
CallableMemberDescriptor.Kind.DECLARATION, this.source
)
@@ -37,14 +37,14 @@ fun FunctionDescriptor.toStatic(
var offset = 0
val dispatchReceiver = dispatchReceiverParameter?.let {
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
)
}
val extensionReceiver = extensionReceiverParameter?.let {
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
)
}