fixes regression #23280; Operations on inline toOpenArray len return a wrong result (#23285)

fixes #23280
This commit is contained in:
ringabout
2024-02-06 13:24:02 +08:00
committed by GitHub
parent 3550c907de
commit 4b67cccf50
2 changed files with 13 additions and 3 deletions

View File

@@ -123,3 +123,13 @@ proc bug19613 =
doAssert x.bid.root.data[0] == 42
bug19613()
proc foo = # bug #23280
let foo = @[1,2,3,4,5,6]
doAssert toOpenArray(foo, 0, 5).len == 6
doAssert toOpenArray(foo, 0, 5).len mod 6 == 0 # this should output 0
doAssert toOpenArray(foo, 0, 5).max mod 6 == 0
let L = toOpenArray(foo, 0, 5).len
doAssert L mod 6 == 0
foo()