From 8ecf0569277f0bebeb4c4208ad2bbc3d9b363bc4 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 12 Nov 2020 16:56:00 +0300 Subject: [PATCH] [FIR2IR] Enter scope a bit earlier in createIrPropertyAccessor --- .../jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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