[FIR2IR] Use FIR symbol instead of IR during conversion of function calls
This commit is contained in:
committed by
Space Team
parent
8083a50017
commit
4da51ee997
+9
-2
@@ -399,10 +399,17 @@ class CallAndReferenceGenerator(
|
|||||||
when (symbol) {
|
when (symbol) {
|
||||||
is IrConstructorSymbol -> IrConstructorCallImpl.fromSymbolOwner(startOffset, endOffset, type, symbol)
|
is IrConstructorSymbol -> IrConstructorCallImpl.fromSymbolOwner(startOffset, endOffset, type, symbol)
|
||||||
is IrSimpleFunctionSymbol -> {
|
is IrSimpleFunctionSymbol -> {
|
||||||
|
require(firSymbol is FirCallableSymbol<*>) { "Illegal symbol: ${firSymbol!!::class}" }
|
||||||
|
val valueParametersNumber = when (firSymbol) {
|
||||||
|
is FirSyntheticPropertySymbol -> 0
|
||||||
|
is FirNamedFunctionSymbol -> firSymbol.valueParameterSymbols.size + firSymbol.resolvedContextReceivers.size
|
||||||
|
is FirFunctionSymbol<*> -> firSymbol.valueParameterSymbols.size
|
||||||
|
else -> error("Illegal symbol: ${firSymbol::class}")
|
||||||
|
}
|
||||||
IrCallImpl(
|
IrCallImpl(
|
||||||
startOffset, endOffset, type, symbol,
|
startOffset, endOffset, type, symbol,
|
||||||
typeArgumentsCount = symbol.owner.typeParameters.size,
|
typeArgumentsCount = firSymbol.typeParameterSymbols.size,
|
||||||
valueArgumentsCount = symbol.owner.valueParameters.size,
|
valueArgumentsCount = valueParametersNumber,
|
||||||
origin = calleeReference.statementOrigin(),
|
origin = calleeReference.statementOrigin(),
|
||||||
superQualifierSymbol = dispatchReceiver.superQualifierSymbol()
|
superQualifierSymbol = dispatchReceiver.superQualifierSymbol()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user