[FIR] Fix value parameter indexes when using context receivers
#KT-1179 #KT-10468
This commit is contained in:
committed by
Space Team
parent
bf5fa61ffb
commit
d24eaf13b5
+1
-1
@@ -333,7 +333,7 @@ class Fir2IrDeclarationStorage(
|
||||
): IrValueParameter {
|
||||
return irFactory.createValueParameter(
|
||||
startOffset, endOffset, IrDeclarationOrigin.DEFINED, IrValueParameterSymbolImpl(),
|
||||
name ?: SpecialNames.IMPLICIT_SET_PARAMETER, 0, type,
|
||||
name ?: SpecialNames.IMPLICIT_SET_PARAMETER, parent.contextReceiverParametersCount, type,
|
||||
varargElementType = null,
|
||||
isCrossinline = isCrossinline, isNoinline = isNoinline,
|
||||
isHidden = false, isAssignable = false
|
||||
|
||||
@@ -109,7 +109,7 @@ class Fir2IrLazyConstructor(
|
||||
|
||||
fir.valueParameters.mapIndexedTo(this) { index, valueParameter ->
|
||||
declarationStorage.createIrParameter(
|
||||
valueParameter, index,
|
||||
valueParameter, index + contextReceiverParametersCount,
|
||||
useStubForDefaultValueStub = (parent as? IrClass)?.name != Name.identifier("Enum")
|
||||
).apply {
|
||||
this.parent = this@Fir2IrLazyConstructor
|
||||
|
||||
@@ -76,7 +76,7 @@ class Fir2IrLazySimpleFunction(
|
||||
|
||||
fir.valueParameters.mapIndexedTo(this) { index, valueParameter ->
|
||||
declarationStorage.createIrParameter(
|
||||
valueParameter, index, skipDefaultParameter = isFakeOverride
|
||||
valueParameter, index + contextReceiverParametersCount, skipDefaultParameter = isFakeOverride
|
||||
).apply {
|
||||
this.parent = this@Fir2IrLazySimpleFunction
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user