IR: do not inherit IrFakeOverride* from IrFunction/IrProperty
This will help to reduce boilerplate after making the latter classes. Without this change, IrFunctionCommonImpl would not be able to be a class because it would introduce a diamond class hierarchy, and thus that would require copying all its contents to IrFunctionImpl and IrFakeOverrideFunctionImpl.
This commit is contained in:
+1
-1
@@ -185,7 +185,7 @@ object IrFactoryImpl : IrFactory {
|
||||
isDelegated: Boolean,
|
||||
isExternal: Boolean,
|
||||
isExpect: Boolean,
|
||||
): IrFakeOverrideProperty =
|
||||
): IrProperty =
|
||||
IrFakeOverridePropertyImpl(
|
||||
startOffset, endOffset, origin, name, visibility, modality,
|
||||
isVar, isConst, isLateinit, isDelegated, isExternal, isExpect,
|
||||
|
||||
+2
-1
@@ -104,10 +104,11 @@ class IrFakeOverrideFunctionImpl(
|
||||
get() = _symbol?.descriptor ?: WrappedSimpleFunctionDescriptor()
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override fun acquireSymbol(symbol: IrSimpleFunctionSymbol) {
|
||||
override fun acquireSymbol(symbol: IrSimpleFunctionSymbol): IrSimpleFunction {
|
||||
assert(_symbol == null) { "$this already has symbol _symbol" }
|
||||
_symbol = symbol
|
||||
symbol.bind(this)
|
||||
(symbol.descriptor as? WrappedSimpleFunctionDescriptor)?.bind(this)
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -103,10 +103,11 @@ class IrFakeOverridePropertyImpl(
|
||||
get() = _symbol?.descriptor ?: WrappedPropertyDescriptor()
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override fun acquireSymbol(symbol: IrPropertySymbol) {
|
||||
override fun acquireSymbol(symbol: IrPropertySymbol): IrProperty {
|
||||
assert(_symbol == null) { "$this already has symbol _symbol" }
|
||||
_symbol = symbol
|
||||
symbol.bind(this)
|
||||
(symbol.descriptor as? WrappedPropertyDescriptor)?.bind(this)
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user