diff --git a/idea/idea-jvm/src/com/intellij/debugger/streams/kotlin/trace/impl/handler/sequence/KotlinDistinctByHandler.kt b/idea/idea-jvm/src/com/intellij/debugger/streams/kotlin/trace/impl/handler/sequence/KotlinDistinctByHandler.kt index e88ca38cc4d..bf51f83a463 100644 --- a/idea/idea-jvm/src/com/intellij/debugger/streams/kotlin/trace/impl/handler/sequence/KotlinDistinctByHandler.kt +++ b/idea/idea-jvm/src/com/intellij/debugger/streams/kotlin/trace/impl/handler/sequence/KotlinDistinctByHandler.kt @@ -28,9 +28,9 @@ class KotlinDistinctByHandler(callNumber: Int, private val call: IntermediateStr private val keyExtractor: CallArgument private val extractorVariable: Variable private val beforeTimes = dsl.list(dsl.types.INT, call.name + callNumber + "BeforeTimes") - private val beforeValues = dsl.list(KotlinTypes.NULLABLE_ANY, call.name + callNumber + "BeforeValues") + private val beforeValues = dsl.list(call.typeBefore, call.name + callNumber + "BeforeValues") private val keys = dsl.list(KotlinTypes.NULLABLE_ANY, call.name + callNumber + "Keys") - private val time2ValueAfter = dsl.linkedMap(dsl.types.INT, KotlinTypes.NULLABLE_ANY, call.name + callNumber + "after") + private val time2ValueAfter = dsl.linkedMap(dsl.types.INT, call.typeAfter, call.name + callNumber + "after") init { val arguments = call.arguments @@ -81,7 +81,7 @@ class KotlinDistinctByHandler(callNumber: Int, private val call: IntermediateStr forEachLoop(variable(types.INT, "afterTime"), time2ValueAfter.keys()) { val afterTime = loopVariable - val valueAfter = declare(variable(KotlinTypes.NULLABLE_ANY, "valueAfter"), time2ValueAfter.get(loopVariable), false) + val valueAfter = declare(variable(call.typeAfter, "valueAfter"), time2ValueAfter.get(loopVariable), false) val key = declare(variable(KotlinTypes.NULLABLE_ANY, "key"), nullExpression, true) integerIteration(beforeTimes.size(), forEachLoop@ this) { ifBranch((valueAfter same beforeValues.get(loopVariable)) and !transitions.contains(beforeTimes.get(loopVariable))) { diff --git a/idea/testData/debugger/sequence/exec/sequence/src/distinct/DistinctByBigPrimitives.kt b/idea/testData/debugger/sequence/exec/sequence/src/distinct/DistinctByBigPrimitives.kt new file mode 100644 index 00000000000..5d455d00936 --- /dev/null +++ b/idea/testData/debugger/sequence/exec/sequence/src/distinct/DistinctByBigPrimitives.kt @@ -0,0 +1,8 @@ +package distinct + +fun main(args: Array) { + // Breakpoint! + val seq = (22..25).map { it * it }.asSequence() + .distinctBy { it.toString().first() } + .count() +} \ No newline at end of file diff --git a/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/DistinctOperationsTest.kt b/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/DistinctOperationsTest.kt index c5a7017eed0..50ab03a44ec 100644 --- a/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/DistinctOperationsTest.kt +++ b/idea/tests/com/intellij/debugger/streams/kotlin/exec/sequence/DistinctOperationsTest.kt @@ -12,4 +12,5 @@ class DistinctOperationsTest : OperationsTestCase("distinct") { fun testDistinctByNullableElement() = doTestWithResult() fun testDistinctByNullableKey() = doTestWithResult() fun testDistinctByNullableKeyAndElement() = doTestWithResult() + fun testDistinctByBigPrimitives() = doTestWithResult() } \ No newline at end of file