[ULC] Fix delegate field type resolve

Fixed #KT-46519
This commit is contained in:
Igor Yakovlev
2021-05-14 18:36:31 +02:00
committed by TeamCityServer
parent a02cecec20
commit b0df70dbfe
@@ -114,9 +114,8 @@ internal open class KtUltraLightFieldImpl protected constructor(
private val kotlinType: KotlinType?
get() = when {
declaration is KtProperty && declaration.hasDelegate() ->
(variableDescriptor as? PropertyDescriptor)?.let {
val context = LightClassGenerationSupport.getInstance(project).analyze(declaration)
PropertyCodegen.getDelegateTypeForProperty(it, context)
declaration.delegateExpression?.let {
LightClassGenerationSupport.getInstance(project).analyze(it).getType(it)
}
declaration is KtObjectDeclaration ->
(declaration.resolve() as? ClassDescriptor)?.defaultType