[FIR] Check for extension and context receiver in isMethodOfAny utility

This commit is contained in:
Dmitriy Novozhilov
2023-07-05 11:07:44 +03:00
committed by Space Team
parent 210ad770aa
commit 1ca1616528
@@ -62,6 +62,8 @@ val FirMemberDeclaration.nameOrSpecialName: Name
val FirNamedFunctionSymbol.isMethodOfAny: Boolean
get() {
if (receiverParameter != null) return false
if (resolvedContextReceivers.isNotEmpty()) return false
return when (name) {
OperatorNameConventions.EQUALS -> valueParameterSymbols.singleOrNull()?.resolvedReturnType?.isNullableAny == true
OperatorNameConventions.HASH_CODE, OperatorNameConventions.TO_STRING -> fir.valueParameters.isEmpty()