Analysis API: rename KtCallableSymbol.type -> returnType

This commit is contained in:
Ilya Kirillov
2021-11-19 18:56:03 +01:00
parent 9d6da14847
commit 1d1f5ace8f
112 changed files with 436 additions and 436 deletions
@@ -82,7 +82,7 @@ internal class FirLightClassForEnumEntry(
private val _extendsList: PsiReferenceList? by lazyPub {
val mappedType = analyzeWithSymbolAsContext(enumEntrySymbol) {
enumEntrySymbol.type.asPsiType(this@FirLightClassForEnumEntry, KtTypeMappingMode.SUPER_TYPE) as? PsiClassType
enumEntrySymbol.returnType.asPsiType(this@FirLightClassForEnumEntry, KtTypeMappingMode.SUPER_TYPE) as? PsiClassType
?: return@lazyPub null
}
@@ -66,7 +66,7 @@ internal class FirLightFieldForEnumEntry(
private val _type: PsiType by lazyPub {
analyzeWithSymbolAsContext(enumEntrySymbol) {
enumEntrySymbol.type.asPsiType(this@FirLightFieldForEnumEntry)
enumEntrySymbol.returnType.asPsiType(this@FirLightFieldForEnumEntry)
} ?: nonExistentType()
}
@@ -39,7 +39,7 @@ internal class FirLightFieldForPropertySymbol(
it.getKtType()?.asPsiType(this@FirLightFieldForPropertySymbol, KtTypeMappingMode.RETURN_TYPE)
}
else -> {
propertySymbol.type.asPsiType(this@FirLightFieldForPropertySymbol, KtTypeMappingMode.RETURN_TYPE)
propertySymbol.returnType.asPsiType(this@FirLightFieldForPropertySymbol, KtTypeMappingMode.RETURN_TYPE)
}
}
} ?: nonExistentType()
@@ -93,7 +93,7 @@ internal class FirLightFieldForPropertySymbol(
val nullability = if (!(propertySymbol is KtKotlinPropertySymbol && propertySymbol.isLateInit)) {
analyzeWithSymbolAsContext(propertySymbol) {
getTypeNullability(propertySymbol.type)
getTypeNullability(propertySymbol.returnType)
}
} else NullabilityType.Unknown
@@ -75,7 +75,7 @@ internal class FirLightAccessorMethodForSymbol(
val nullabilityType = if (nullabilityApplicable) {
analyzeWithSymbolAsContext(containingPropertySymbol) {
getTypeNullability(
containingPropertySymbol.type
containingPropertySymbol.returnType
)
}
} else NullabilityType.Unknown
@@ -151,7 +151,7 @@ internal class FirLightAccessorMethodForSymbol(
private val _returnedType: PsiType by lazyPub {
if (!isGetter) return@lazyPub PsiType.VOID
analyzeWithSymbolAsContext(containingPropertySymbol) {
containingPropertySymbol.type.asPsiType(
containingPropertySymbol.returnType.asPsiType(
this@FirLightAccessorMethodForSymbol,
KtTypeMappingMode.RETURN_TYPE,
containingClass.isAnnotationType
@@ -66,7 +66,7 @@ internal class FirLightSimpleMethodForSymbol(
isVoidReturnType ->
return@l NullabilityType.Unknown
else ->
functionSymbol.type
functionSymbol.returnType
}
getTypeNullability(ktType)
}
@@ -131,7 +131,7 @@ internal class FirLightSimpleMethodForSymbol(
override fun isConstructor(): Boolean = false
private val isVoidReturnType: Boolean
get() = functionSymbol.type.run {
get() = functionSymbol.returnType.run {
isUnit && nullabilityType != NullabilityType.Nullable
}
@@ -144,7 +144,7 @@ internal class FirLightSimpleMethodForSymbol(
isVoidReturnType ->
return@lazyPub PsiType.VOID
else ->
functionSymbol.type
functionSymbol.returnType
}
ktType.asPsiType(
this@FirLightSimpleMethodForSymbol,
@@ -37,7 +37,7 @@ internal abstract class FirLightParameterBaseForSymbol(
return if (nullabilityApplicable) {
analyzeWithSymbolAsContext(parameterSymbol) {
getTypeNullability(
parameterSymbol.type
parameterSymbol.returnType
)
}
} else NullabilityType.Unknown
@@ -47,7 +47,7 @@ internal abstract class FirLightParameterBaseForSymbol(
private val _type by lazyPub {
val convertedType = analyzeWithSymbolAsContext(parameterSymbol) {
val ktType = parameterSymbol.type
val ktType = parameterSymbol.returnType
val typeMappingMode = when {
ktType.isSuspendFunctionType -> KtTypeMappingMode.DEFAULT
// TODO: extract type mapping mode from annotation?
@@ -35,7 +35,7 @@ internal class FirLightSuspendContinuationParameter(
private val _type by lazyPub {
analyzeWithSymbolAsContext(functionSymbol) {
buildClassType(StandardClassIds.Continuation) {
argument(functionSymbol.type)
argument(functionSymbol.returnType)
}.asPsiType(this@FirLightSuspendContinuationParameter)
} ?: nonExistentType()
}