Move generation of fake call to common CodegenUtil to share between JS and JVM
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.bridges.findInterfaceImplementation
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
@@ -154,4 +155,12 @@ object CodegenUtil {
|
||||
}
|
||||
return this[slice, whenExpression] == true
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun constructFakeFunctionCall(project: Project, referencedFunction: FunctionDescriptor): KtCallExpression {
|
||||
val fakeFunctionCall = StringBuilder("callableReferenceFakeCall(")
|
||||
fakeFunctionCall.append(referencedFunction.valueParameters.map { "p${it.index}" }.joinToString(", "))
|
||||
fakeFunctionCall.append(")")
|
||||
return KtPsiFactory(project).createExpression(fakeFunctionCall.toString()) as KtCallExpression
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user