IR: make IrGetValue.copyWithOffsets an extension function
This commit is contained in:
-3
@@ -662,9 +662,6 @@ class FunctionInlining(
|
|||||||
|
|
||||||
fun withLocation(startOffset: Int, endOffset: Int) =
|
fun withLocation(startOffset: Int, endOffset: Int) =
|
||||||
IrGetValueImpl(startOffset, endOffset, type, symbol, origin)
|
IrGetValueImpl(startOffset, endOffset, type, symbol, origin)
|
||||||
|
|
||||||
override fun copyWithOffsets(newStartOffset: Int, newEndOffset: Int): IrGetValue =
|
|
||||||
withLocation(newStartOffset, newEndOffset)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ package org.jetbrains.kotlin.ir.expressions
|
|||||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||||
|
|
||||||
abstract class IrGetValue : IrValueAccessExpression() {
|
abstract class IrGetValue : IrValueAccessExpression() {
|
||||||
abstract fun copyWithOffsets(newStartOffset: Int, newEndOffset: Int): IrGetValue
|
|
||||||
|
|
||||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||||
visitor.visitGetValue(this, data)
|
visitor.visitGetValue(this, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class IrGetValueImpl(
|
|||||||
symbol: IrValueSymbol,
|
symbol: IrValueSymbol,
|
||||||
origin: IrStatementOrigin? = null
|
origin: IrStatementOrigin? = null
|
||||||
) : this(startOffset, endOffset, symbol.owner.type, symbol, origin)
|
) : this(startOffset, endOffset, symbol.owner.type, symbol, origin)
|
||||||
|
|
||||||
override fun copyWithOffsets(newStartOffset: Int, newEndOffset: Int): IrGetValue =
|
|
||||||
IrGetValueImpl(newStartOffset, newEndOffset, type, symbol, origin)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun IrGetValue.copyWithOffsets(newStartOffset: Int, newEndOffset: Int): IrGetValue =
|
||||||
|
IrGetValueImpl(newStartOffset, newEndOffset, type, symbol, origin)
|
||||||
|
|||||||
Reference in New Issue
Block a user