[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 {
|
): IrValueParameter {
|
||||||
return irFactory.createValueParameter(
|
return irFactory.createValueParameter(
|
||||||
startOffset, endOffset, IrDeclarationOrigin.DEFINED, IrValueParameterSymbolImpl(),
|
startOffset, endOffset, IrDeclarationOrigin.DEFINED, IrValueParameterSymbolImpl(),
|
||||||
name ?: SpecialNames.IMPLICIT_SET_PARAMETER, 0, type,
|
name ?: SpecialNames.IMPLICIT_SET_PARAMETER, parent.contextReceiverParametersCount, type,
|
||||||
varargElementType = null,
|
varargElementType = null,
|
||||||
isCrossinline = isCrossinline, isNoinline = isNoinline,
|
isCrossinline = isCrossinline, isNoinline = isNoinline,
|
||||||
isHidden = false, isAssignable = false
|
isHidden = false, isAssignable = false
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class Fir2IrLazyConstructor(
|
|||||||
|
|
||||||
fir.valueParameters.mapIndexedTo(this) { index, valueParameter ->
|
fir.valueParameters.mapIndexedTo(this) { index, valueParameter ->
|
||||||
declarationStorage.createIrParameter(
|
declarationStorage.createIrParameter(
|
||||||
valueParameter, index,
|
valueParameter, index + contextReceiverParametersCount,
|
||||||
useStubForDefaultValueStub = (parent as? IrClass)?.name != Name.identifier("Enum")
|
useStubForDefaultValueStub = (parent as? IrClass)?.name != Name.identifier("Enum")
|
||||||
).apply {
|
).apply {
|
||||||
this.parent = this@Fir2IrLazyConstructor
|
this.parent = this@Fir2IrLazyConstructor
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class Fir2IrLazySimpleFunction(
|
|||||||
|
|
||||||
fir.valueParameters.mapIndexedTo(this) { index, valueParameter ->
|
fir.valueParameters.mapIndexedTo(this) { index, valueParameter ->
|
||||||
declarationStorage.createIrParameter(
|
declarationStorage.createIrParameter(
|
||||||
valueParameter, index, skipDefaultParameter = isFakeOverride
|
valueParameter, index + contextReceiverParametersCount, skipDefaultParameter = isFakeOverride
|
||||||
).apply {
|
).apply {
|
||||||
this.parent = this@Fir2IrLazySimpleFunction
|
this.parent = this@Fir2IrLazySimpleFunction
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user