[IR] Move assert in IrSetValueImpl to factory function
#KT-65773 In Progress
This commit is contained in:
committed by
Space Team
parent
62f546ca0c
commit
b032e647f7
+14
-15
@@ -25,12 +25,6 @@ class IrSetValueImpl internal constructor(
|
|||||||
) : IrSetValue() {
|
) : IrSetValue() {
|
||||||
override var attributeOwnerId: IrAttributeContainer = this
|
override var attributeOwnerId: IrAttributeContainer = this
|
||||||
override var originalBeforeInline: IrAttributeContainer? = null
|
override var originalBeforeInline: IrAttributeContainer? = null
|
||||||
|
|
||||||
init {
|
|
||||||
if (symbol.isBound) {
|
|
||||||
assert(symbol.owner.isAssignable) { "Only assignable IrValues can be set" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun IrSetValueImpl(
|
fun IrSetValueImpl(
|
||||||
@@ -40,12 +34,17 @@ fun IrSetValueImpl(
|
|||||||
symbol: IrValueSymbol,
|
symbol: IrValueSymbol,
|
||||||
value: IrExpression,
|
value: IrExpression,
|
||||||
origin: IrStatementOrigin?,
|
origin: IrStatementOrigin?,
|
||||||
) = IrSetValueImpl(
|
): IrSetValueImpl {
|
||||||
constructorIndicator = null,
|
if (symbol.isBound) {
|
||||||
startOffset = startOffset,
|
assert(symbol.owner.isAssignable) { "Only assignable IrValues can be set" }
|
||||||
endOffset = endOffset,
|
}
|
||||||
type = type,
|
return IrSetValueImpl(
|
||||||
symbol = symbol,
|
constructorIndicator = null,
|
||||||
value = value,
|
startOffset = startOffset,
|
||||||
origin = origin,
|
endOffset = endOffset,
|
||||||
)
|
type = type,
|
||||||
|
symbol = symbol,
|
||||||
|
value = value,
|
||||||
|
origin = origin,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user