[Analysis API Fe10] add missing initializer for properties
This commit is contained in:
+9
-1
@@ -76,7 +76,15 @@ internal class KtFe10DescKotlinPropertySymbol(
|
||||
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||
|
||||
override val initializer: KtInitializerValue?
|
||||
get() = withValidityAssertion { createKtInitializerValue(source as? KtProperty, descriptor, analysisContext) }
|
||||
get() = withValidityAssertion {
|
||||
val initializer = when (val psi = psi) {
|
||||
is KtProperty -> psi.initializer
|
||||
is KtParameter -> psi
|
||||
else -> null
|
||||
}
|
||||
|
||||
createKtInitializerValue(initializer, descriptor, analysisContext)
|
||||
}
|
||||
|
||||
override val getter: KtPropertyGetterSymbol
|
||||
get() = withValidityAssertion {
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ internal class KtFe10DescSyntheticJavaPropertySymbol(
|
||||
get() = withValidityAssertion { null }
|
||||
|
||||
override val initializer: KtInitializerValue?
|
||||
get() = withValidityAssertion { createKtInitializerValue(source as? KtProperty, descriptor, analysisContext) }
|
||||
get() = withValidityAssertion { createKtInitializerValue((psi as? KtProperty)?.initializer, descriptor, analysisContext) }
|
||||
|
||||
override val callableIdIfNonLocal: CallableId?
|
||||
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ internal class KtFe10DescSyntheticJavaPropertySymbolForOverride(
|
||||
get() = withValidityAssertion { null }
|
||||
|
||||
override val initializer: KtInitializerValue?
|
||||
get() = withValidityAssertion { createKtInitializerValue(source as? KtProperty, descriptor, analysisContext) }
|
||||
get() = withValidityAssertion { createKtInitializerValue((psi as? KtProperty)?.initializer, descriptor, analysisContext) }
|
||||
|
||||
override val callableIdIfNonLocal: CallableId?
|
||||
get() = withValidityAssertion { descriptor.callableIdIfNotLocal }
|
||||
|
||||
+3
-5
@@ -46,7 +46,7 @@ import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.psi.KtCallElement
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtProperty
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.CapturedType
|
||||
@@ -585,15 +585,13 @@ internal fun CallableMemberDescriptor.getSymbolPointerSignature(): String {
|
||||
}
|
||||
|
||||
internal fun createKtInitializerValue(
|
||||
ktProperty: KtProperty?,
|
||||
initializer: KtExpression?,
|
||||
propertyDescriptor: PropertyDescriptor?,
|
||||
analysisContext: Fe10AnalysisContext,
|
||||
): KtInitializerValue? {
|
||||
require(ktProperty != null || propertyDescriptor != null)
|
||||
if (ktProperty?.initializer == null && propertyDescriptor?.compileTimeInitializer == null) {
|
||||
if (initializer == null && propertyDescriptor?.compileTimeInitializer == null) {
|
||||
return null
|
||||
}
|
||||
val initializer = ktProperty?.initializer
|
||||
|
||||
val compileTimeInitializer = propertyDescriptor?.compileTimeInitializer
|
||||
if (compileTimeInitializer != null) {
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ internal class KtFe10PsiKotlinPropertySymbol(
|
||||
get() = withValidityAssertion { descriptor?.isExpect ?: psi.hasExpectModifier() }
|
||||
|
||||
override val initializer: KtInitializerValue?
|
||||
get() = withValidityAssertion { createKtInitializerValue(psi, descriptor, analysisContext) }
|
||||
get() = withValidityAssertion { createKtInitializerValue(psi.initializer, descriptor, analysisContext) }
|
||||
|
||||
override val isVal: Boolean
|
||||
get() = withValidityAssertion { !psi.isVar }
|
||||
|
||||
Reference in New Issue
Block a user