SLC: fix type mapping mode for var

^KT-57578
This commit is contained in:
Jinseong Jeon
2023-04-03 18:10:00 -07:00
committed by Ilya Kirillov
parent 95491f223c
commit 5403cc7feb
2 changed files with 8 additions and 3 deletions
@@ -66,10 +66,15 @@ internal class SymbolLightFieldForProperty private constructor(
(kotlinOrigin as? KtProperty)?.delegateExpression?.getKtType()
else
propertySymbol.returnType
// See [KotlinTypeMapper#writeFieldSignature]
val typeMappingMode = if (propertySymbol.isVal)
KtTypeMappingMode.RETURN_TYPE
else
KtTypeMappingMode.VALUE_PARAMETER
ktType?.asPsiType(
this@SymbolLightFieldForProperty,
allowErrorTypes = true,
KtTypeMappingMode.RETURN_TYPE
typeMappingMode,
)
} ?: nonExistentType()
}