IR: make IrConst.copyWithOffsets an extension function
Co-authored-by: mcpiroman <mcpiroman@gmail.com>
This commit is contained in:
@@ -11,8 +11,6 @@ abstract class IrConst<T> : IrExpression() {
|
||||
abstract val kind: IrConstKind<T>
|
||||
abstract val value: T
|
||||
|
||||
abstract fun copyWithOffsets(startOffset: Int, endOffset: Int): IrConst<T>
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitConst(this, data)
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@ class IrConstImpl<T>(
|
||||
override val kind: IrConstKind<T>,
|
||||
override val value: T
|
||||
) : IrConst<T>() {
|
||||
override fun copyWithOffsets(startOffset: Int, endOffset: Int) =
|
||||
IrConstImpl(startOffset, endOffset, type, kind, value)
|
||||
|
||||
companion object {
|
||||
fun string(startOffset: Int, endOffset: Int, type: IrType, value: String): IrConstImpl<String> =
|
||||
IrConstImpl(startOffset, endOffset, type, IrConstKind.String, value)
|
||||
@@ -86,3 +83,6 @@ class IrConstImpl<T>(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> IrConst<T>.copyWithOffsets(startOffset: Int, endOffset: Int) =
|
||||
IrConstImpl(startOffset, endOffset, type, kind, value)
|
||||
|
||||
Reference in New Issue
Block a user