From 85f692ab404c9f577c877166271fa752f3ef741c Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Tue, 21 Jul 2020 10:46:30 -0700 Subject: [PATCH] FIR2IR: use DescriptorWithContainerSource if container source is available The use of DescriptorWithContainerSource is the key to trigger the proper generation of stub facade class as parent. --- .../kotlin/fir/backend/Fir2IrDeclarationStorage.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 03f6ce10785..e5ef66526cf 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 @@ -355,7 +355,9 @@ class Fir2IrDeclarationStorage( factory: (IrSimpleFunctionSymbol) -> IrSimpleFunction ): IrSimpleFunction { if (signature == null) { - val descriptor = WrappedSimpleFunctionDescriptor() + val descriptor = + if (containerSource != null) WrappedFunctionDescriptorWithContainerSource(containerSource) + else WrappedSimpleFunctionDescriptor() return symbolTable.declareSimpleFunction(descriptor, factory).apply { descriptor.bind(this) } } return symbolTable.declareSimpleFunction(signature, { Fir2IrSimpleFunctionSymbol(signature, containerSource) }, factory) @@ -601,7 +603,9 @@ class Fir2IrDeclarationStorage( factory: (IrPropertySymbol) -> IrProperty ): IrProperty { if (signature == null) { - val descriptor = WrappedPropertyDescriptor() + val descriptor = + if (containerSource != null) WrappedPropertyDescriptorWithContainerSource(containerSource) + else WrappedPropertyDescriptor() return symbolTable.declareProperty(0, 0, IrDeclarationOrigin.DEFINED, descriptor, isDelegated = false, factory).apply { descriptor.bind(this) }