[FIR] FirFakeOverrideGenerator: drop fake attributes from value parameters
We can find corresponding parameters by the containing function symbol. Analysis API part is covered by tests from: * FirIdeNormalAnalysisSourceModuleResolveCandidatesTestGenerated * FirIdeNormalAnalysisSourceModuleResolveCallTestGenerated * FirIdeNormalAnalysisSourceModuleTypeScopeTestGenerated ^KT-64243
This commit is contained in:
committed by
Space Team
parent
ed6a67b26d
commit
357015f399
+13
-2
@@ -340,9 +340,20 @@ internal class KtSymbolByFirBuilder(
|
||||
}
|
||||
|
||||
fun buildValueParameterSymbol(firSymbol: FirValueParameterSymbol): KtValueParameterSymbol {
|
||||
firSymbol.fir.unwrapSubstitutionOverrideIfNeeded()?.let {
|
||||
return buildValueParameterSymbol(it.symbol)
|
||||
val functionSymbol = firSymbol.containingFunctionSymbol
|
||||
functionSymbol.fir.unwrapSubstitutionOverrideIfNeeded()?.let { unwrappedFunction ->
|
||||
val originalIndex = functionSymbol.valueParameterSymbols.indexOf(firSymbol)
|
||||
if (originalIndex == -1) {
|
||||
errorWithAttachment("Containing function doesn't have the corresponding parameter") {
|
||||
withFirSymbolEntry("valueParameter", firSymbol)
|
||||
withFirSymbolEntry("function", functionSymbol)
|
||||
}
|
||||
}
|
||||
|
||||
val unwrappedParameter = unwrappedFunction.symbol.valueParameterSymbols[originalIndex]
|
||||
return buildValueParameterSymbol(unwrappedParameter)
|
||||
}
|
||||
|
||||
return symbolsCache.cache(firSymbol) {
|
||||
KtFirValueParameterSymbol(firSymbol, analysisSession)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user