Pass BindingContext to CodegenUtil.getActualDeclarations

Will be used in a subsequent commit. Also rename getActualDeclarations
-> getDeclarationsToGenerate
This commit is contained in:
Alexander Udalov
2018-06-25 14:55:43 +02:00
parent ba6da7c40a
commit 4e217b180a
7 changed files with 27 additions and 18 deletions
@@ -167,9 +167,13 @@ object CodegenUtil {
return KtPsiFactory(project, markGenerated = false).createExpression(fakeFunctionCall) as KtCallExpression
}
/**
* Returns declarations in the given [file] which should be generated by the back-end. This includes all declarations
* minus all expected declarations.
*/
@JvmStatic
fun getActualDeclarations(file: KtFile): List<KtDeclaration> =
file.declarations.filterNot(KtDeclaration::hasExpectModifier)
fun getDeclarationsToGenerate(file: KtFile, bindingContext: BindingContext): List<KtDeclaration> =
file.declarations.filterNot(KtDeclaration::hasExpectModifier)
@JvmStatic
fun findExpectedFunctionForActual(descriptor: FunctionDescriptor): FunctionDescriptor? {