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.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
c076d81f0c
commit
85f692ab40
+6
-2
@@ -355,7 +355,9 @@ class Fir2IrDeclarationStorage(
|
|||||||
factory: (IrSimpleFunctionSymbol) -> IrSimpleFunction
|
factory: (IrSimpleFunctionSymbol) -> IrSimpleFunction
|
||||||
): IrSimpleFunction {
|
): IrSimpleFunction {
|
||||||
if (signature == null) {
|
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(descriptor, factory).apply { descriptor.bind(this) }
|
||||||
}
|
}
|
||||||
return symbolTable.declareSimpleFunction(signature, { Fir2IrSimpleFunctionSymbol(signature, containerSource) }, factory)
|
return symbolTable.declareSimpleFunction(signature, { Fir2IrSimpleFunctionSymbol(signature, containerSource) }, factory)
|
||||||
@@ -601,7 +603,9 @@ class Fir2IrDeclarationStorage(
|
|||||||
factory: (IrPropertySymbol) -> IrProperty
|
factory: (IrPropertySymbol) -> IrProperty
|
||||||
): IrProperty {
|
): IrProperty {
|
||||||
if (signature == null) {
|
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 {
|
return symbolTable.declareProperty(0, 0, IrDeclarationOrigin.DEFINED, descriptor, isDelegated = false, factory).apply {
|
||||||
descriptor.bind(this)
|
descriptor.bind(this)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user