IR: .isBound API for F/O declarations
Fake override functions and properties may not be bound to symbols. This API allows to know if such declaration is actually bound
This commit is contained in:
committed by
teamcityserver
parent
6c734289be
commit
76f0684d7c
+3
@@ -139,4 +139,7 @@ class IrFakeOverrideFunctionImpl(
|
|||||||
symbol.bind(this)
|
symbol.bind(this)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override val isBound: Boolean
|
||||||
|
get() = _symbol != null
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -126,4 +126,7 @@ class IrFakeOverridePropertyImpl(
|
|||||||
symbol.bind(this)
|
symbol.bind(this)
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override val isBound: Boolean
|
||||||
|
get() = _symbol != null
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -75,7 +75,11 @@ internal class PersistentIrFakeOverrideFunction(
|
|||||||
private var _symbol: IrSimpleFunctionSymbol? = null
|
private var _symbol: IrSimpleFunctionSymbol? = null
|
||||||
|
|
||||||
override val symbol: IrSimpleFunctionSymbol
|
override val symbol: IrSimpleFunctionSymbol
|
||||||
get() = _symbol ?: error("$this has not acquired a symbol yet")
|
get() = _symbol ?:
|
||||||
|
error("$this has not acquired a symbol yet")
|
||||||
|
|
||||||
|
override val isBound: Boolean
|
||||||
|
get() = _symbol != null
|
||||||
|
|
||||||
@ObsoleteDescriptorBasedAPI
|
@ObsoleteDescriptorBasedAPI
|
||||||
override val descriptor
|
override val descriptor
|
||||||
|
|||||||
+3
@@ -80,6 +80,9 @@ internal class PersistentIrFakeOverrideProperty(
|
|||||||
override val descriptor
|
override val descriptor
|
||||||
get() = _symbol?.descriptor ?: this.toIrBasedDescriptor()
|
get() = _symbol?.descriptor ?: this.toIrBasedDescriptor()
|
||||||
|
|
||||||
|
override val isBound: Boolean
|
||||||
|
get() = _symbol != null
|
||||||
|
|
||||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||||
override fun acquireSymbol(symbol: IrPropertySymbol): IrProperty {
|
override fun acquireSymbol(symbol: IrPropertySymbol): IrProperty {
|
||||||
assert(_symbol == null) { "$this already has symbol _symbol" }
|
assert(_symbol == null) { "$this already has symbol _symbol" }
|
||||||
|
|||||||
@@ -14,4 +14,6 @@ interface IrFakeOverrideFunction : IrDeclaration {
|
|||||||
var modality: Modality
|
var modality: Modality
|
||||||
|
|
||||||
fun acquireSymbol(symbol: IrSimpleFunctionSymbol): IrSimpleFunction
|
fun acquireSymbol(symbol: IrSimpleFunctionSymbol): IrSimpleFunction
|
||||||
|
|
||||||
|
val isBound: Boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,4 +16,6 @@ interface IrFakeOverrideProperty : IrDeclaration {
|
|||||||
var setter: IrSimpleFunction?
|
var setter: IrSimpleFunction?
|
||||||
|
|
||||||
fun acquireSymbol(symbol: IrPropertySymbol): IrProperty
|
fun acquireSymbol(symbol: IrPropertySymbol): IrProperty
|
||||||
|
|
||||||
|
val isBound: Boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user