diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index ec5b58bb285..8ff7a8d15c2 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -613,12 +613,14 @@ class Fir2IrDeclarationStorage( ) ) } + // NB: we should enter accessor' scope before declaring its parameters + // (both setter default and receiver ones, if any) + enterScope(this) if (propertyAccessor == null && isSetter) { declareDefaultSetterParameter( property.returnTypeRef.toIrType(ConversionTypeContext.DEFAULT.inSetter()) ) } - enterScope(this) bindAndDeclareParameters( propertyAccessor, irParent, thisReceiverOwner, isStatic = irParent !is IrClass, parentPropertyReceiverType = property.receiverTypeRef