[FIR] introduce FirReceiverParameter

^KT-54417
This commit is contained in:
Dmitrii Gridin
2022-10-12 16:26:28 +02:00
committed by Space Team
parent e6801abce8
commit be7d282974
142 changed files with 821 additions and 580 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -92,7 +92,7 @@ fun FirSimpleFunction.isEquals(): Boolean {
if (name != OperatorNameConventions.EQUALS) return false
if (valueParameters.size != 1) return false
if (contextReceivers.isNotEmpty()) return false
if (receiverTypeRef != null) return false
if (receiverParameter != null) return false
val parameter = valueParameters.first()
return parameter.returnTypeRef.isNullableAny
}
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -189,7 +189,7 @@ class VariableStorageImpl(private val session: FirSession) : VariableStorage() {
property.delegate != null -> PropertyStability.DELEGATED_PROPERTY
property.isLocal -> if (property.isVal) PropertyStability.STABLE_VALUE else PropertyStability.LOCAL_VAR
property.isVar -> PropertyStability.MUTABLE_PROPERTY
property.receiverTypeRef != null -> PropertyStability.PROPERTY_WITH_GETTER
property.receiverParameter != null -> PropertyStability.PROPERTY_WITH_GETTER
property.getter.let { it != null && it !is FirDefaultPropertyAccessor } -> PropertyStability.PROPERTY_WITH_GETTER
property.modality != Modality.FINAL -> {
val dispatchReceiver = (originalFir.unwrapElement() as? FirQualifiedAccess)?.dispatchReceiver ?: return null