[K2 AA] add missing receiverType for getter and setter

^KT-54311
This commit is contained in:
Dmitrii Gridin
2022-10-10 19:00:45 +02:00
committed by Space Team
parent afe7605649
commit 027899a22a
8 changed files with 220 additions and 141 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 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.
*/
@@ -22,10 +22,7 @@ import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
import org.jetbrains.kotlin.fir.declarations.utils.isInline
import org.jetbrains.kotlin.fir.declarations.utils.isOverride
import org.jetbrains.kotlin.fir.declarations.utils.modalityOrFinal
import org.jetbrains.kotlin.fir.declarations.utils.visibility
import org.jetbrains.kotlin.fir.declarations.utils.*
import org.jetbrains.kotlin.fir.resolve.getHasStableParameterNames
import org.jetbrains.kotlin.fir.symbols.impl.FirPropertyAccessorSymbol
import org.jetbrains.kotlin.name.CallableId
@@ -50,14 +47,14 @@ internal class KtFirPropertyGetterSymbol(
return firSymbol.fir.propertySymbol.isOverride
}
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.body != null }
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.hasBody }
override val modality: Modality get() = withValidityAssertion { firSymbol.modalityOrFinal }
override val visibility: Visibility get() = withValidityAssertion { firSymbol.visibility }
override val returnType: KtType get() = withValidityAssertion { firSymbol.returnType(builder) }
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.receiverType(builder) }
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.fir.propertySymbol.receiverType(builder) }
override val annotationsList by cached { KtFirAnnotationListForDeclaration.create(firSymbol, firResolveSession.useSiteFirSession, token) }
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2020 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.
*/
@@ -22,10 +22,7 @@ import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticPropertyAccessor
import org.jetbrains.kotlin.fir.declarations.utils.isInline
import org.jetbrains.kotlin.fir.declarations.utils.isOverride
import org.jetbrains.kotlin.fir.declarations.utils.modalityOrFinal
import org.jetbrains.kotlin.fir.declarations.utils.visibility
import org.jetbrains.kotlin.fir.declarations.utils.*
import org.jetbrains.kotlin.fir.resolve.getHasStableParameterNames
import org.jetbrains.kotlin.fir.resolve.scope
import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator
@@ -63,7 +60,7 @@ internal class KtFirPropertySetterSymbol(
overriddenProperties.any { it.isVar }
}
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.body != null }
override val hasBody: Boolean get() = withValidityAssertion { firSymbol.fir.hasBody }
override val modality: Modality get() = withValidityAssertion { firSymbol.modalityOrFinal }
override val visibility: Visibility get() = withValidityAssertion { firSymbol.visibility }
@@ -94,7 +91,7 @@ internal class KtFirPropertySetterSymbol(
override val valueParameters: List<KtValueParameterSymbol> by cached { listOf(parameter) }
override val returnType: KtType get() = withValidityAssertion { firSymbol.returnType(builder) }
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.receiverType(builder) }
override val receiverType: KtType? get() = withValidityAssertion { firSymbol.fir.propertySymbol.receiverType(builder) }
override val hasStableParameterNames: Boolean