Minor. Rename isAnonymousFunction to isFunctionExpression

This commit is contained in:
Denis.Zharkov
2021-11-22 13:35:51 +03:00
committed by teamcityserver
parent c0a46eaefd
commit 61fe70b600
4 changed files with 5 additions and 5 deletions
@@ -81,7 +81,7 @@ object ConeConstraintSystemUtilContext : ConstraintSystemUtilContext {
private fun FirAnonymousFunction.collectDeclaredValueParameterTypes(): List<ConeKotlinType?> =
valueParameters.map { it.returnTypeRef.coneTypeSafe() }
override fun PostponedAtomWithRevisableExpectedType.isAnonymousFunction(): Boolean {
override fun PostponedAtomWithRevisableExpectedType.isFunctionExpression(): Boolean {
require(this is PostponedResolvedAtom)
return this is LambdaWithTypeVariableAsExpectedTypeAtom && !this.atom.anonymousFunction.isLambda
}
@@ -27,7 +27,7 @@ interface ConstraintSystemUtilContext {
fun createArgumentConstraintPosition(argument: PostponedAtomWithRevisableExpectedType): ArgumentConstraintPosition<*>
fun <T> createFixVariableConstraintPosition(variable: TypeVariableMarker, atom: T): FixVariableConstraintPosition<T>
fun extractLambdaParameterTypesFromDeclaration(declaration: PostponedAtomWithRevisableExpectedType): List<KotlinTypeMarker?>?
fun PostponedAtomWithRevisableExpectedType.isAnonymousFunction(): Boolean
fun PostponedAtomWithRevisableExpectedType.isFunctionExpression(): Boolean
fun PostponedAtomWithRevisableExpectedType.isFunctionExpressionWithReceiver(): Boolean
fun createTypeVariableForLambdaReturnType(): TypeVariableMarker
fun createTypeVariableForLambdaParameterType(argument: PostponedAtomWithRevisableExpectedType, index: Int): TypeVariableMarker
@@ -301,7 +301,7 @@ class PostponedArgumentInputTypesResolver(
*
* TODO: regarding anonymous functions: see info about need for analysis in partial mode in `collectParameterTypesAndBuildNewExpectedTypes`
*/
if (areAllParameterTypesSpecified && !isExtensionFunction && !argument.isAnonymousFunction())
if (areAllParameterTypesSpecified && !isExtensionFunction && !argument.isFunctionExpression())
return null
val allParameterTypes =
@@ -389,7 +389,7 @@ class PostponedArgumentInputTypesResolver(
*
* TODO: investigate why we can't do it for anonymous functions in full mode always (see `diagnostics/tests/resolve/resolveWithSpecifiedFunctionLiteralWithId.kt`)
*/
if (completionMode == ConstraintSystemCompletionMode.PARTIAL && !argument.isAnonymousFunction())
if (completionMode == ConstraintSystemCompletionMode.PARTIAL && !argument.isFunctionExpression())
return@any false
if (argument.revisedExpectedType != null) return@any false
val parameterTypesInfo =
@@ -72,7 +72,7 @@ class ClassicConstraintSystemUtilContext(
}
}
override fun PostponedAtomWithRevisableExpectedType.isAnonymousFunction(): Boolean {
override fun PostponedAtomWithRevisableExpectedType.isFunctionExpression(): Boolean {
require(this is ResolvedAtom)
return this.atom is FunctionExpression
}