Take ReceiverParameterDescriptor in FunctionDescriptorImpl.initialize

Instead of just KotlinType. This will allow to pass annotations on the
receiver at call sites
This commit is contained in:
Alexander Udalov
2018-08-08 16:35:21 +02:00
parent 6fb39785ff
commit 34c033bcaf
39 changed files with 200 additions and 107 deletions
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.PropertyGetterDescriptorImpl
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.DescriptorFactory
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
@@ -46,8 +47,10 @@ internal fun genClearCacheFunction(packageFragmentDescriptor: PackageFragmentDes
SourceElement.NO_SOURCE) {}
val unitType = packageFragmentDescriptor.builtIns.unitType
function.initialize(receiverType, null, emptyList(), emptyList(), unitType, Modality.FINAL, Visibilities.PUBLIC)
return function
return function.initialize(
DescriptorFactory.createExtensionReceiverParameterForCallable(function, receiverType, Annotations.EMPTY),
null, emptyList(), emptyList(), unitType, Modality.FINAL, Visibilities.PUBLIC
)
}
internal fun genPropertyForWidget(