Force resolve companion in light class generation

This commit is contained in:
Michael Bogdanov
2015-12-11 15:17:21 +03:00
parent a849f3f5d4
commit 39d9b35e27
2 changed files with 5 additions and 7 deletions
@@ -80,11 +80,13 @@ public class CliLightClassGenerationSupport(project: Project) : LightClassGenera
}
override fun getContextForPackage(files: Collection<KtFile>): LightClassConstructionContext {
return getContext()
return LightClassConstructionContext(bindingContext, module)
}
override fun getContextForClassOrObject(classOrObject: KtClassOrObject): LightClassConstructionContext {
return getContext()
//force resolve companion for light class generation
bindingContext.get(BindingContext.CLASS, classOrObject)?.companionObjectDescriptor
return LightClassConstructionContext(bindingContext, module)
}
private fun getContext(): LightClassConstructionContext {