Closed skaman closed 2 weeks ago
Interesting. The previous fix did indeed fix the examples given there:
s := []int{2,2,2}
res := slice.unique(s)
assert(slice.equal(res,[]int{2}))
res = slice.unique([]int{1,1,1,2,2,3,3,3,3})
assert(slice.equal(res, []int{1,2,3}))
res = slice.unique_proc([]int{1,1,1,2,2,3,3,3,3}, proc(a, b: int) -> bool {
return a == b
})
assert(slice.equal(res, []int{1,2,3}))
But I can also reproduce the bug you found using that old fix.
I'll have a look at your fix momentarily and will write more extensive test coverage for tests/core/slice
.
Fixed by #3770.
Context
Odin: dev-2024-06-nightly:f745a1c47 OS: Windows 11 Professional (version: 23H2), build 22631.3737 CPU: AMD Ryzen Threadripper 3970X 32-Core Processor RAM: 65414 MiB Backend: LLVM 17.0.1
Expected Behavior
Given this example code
It should output:
Current Behavior
The output that currently i get is:
Failure Information (for bugs)
I think the bug is related to:
In detail the index
i
not increase when it's equal withj
but it should.Steps to Reproduce