[K2] Use file name as one of parameters to extract evaluated const
It is not enough to store evaluated constants only by <startOffset, endOffset> pair. We need to consider case there constant can be located in different files with the same offset but with different values. #KT-57928 Fixed #KT-57929 Fixed
This commit is contained in:
+2
-1
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.interpreter.isPrimitiveArray
|
||||
import org.jetbrains.kotlin.ir.types.*
|
||||
import org.jetbrains.kotlin.ir.util.dump
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
|
||||
@@ -76,7 +77,7 @@ class IrConstTransformer(
|
||||
}
|
||||
|
||||
evaluatedConstTracker?.save(
|
||||
result.startOffset, result.endOffset,
|
||||
result.startOffset, result.endOffset, irFile.fqName.child(Name.identifier(irFile.name)).asString(),
|
||||
constant = if (result is IrErrorExpression) ErrorValue.create(result.description)
|
||||
else (result as IrConst<*>).toConstantValue()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user