enable experimental:strictDefs (#24225)

This commit is contained in:
ringabout
2024-11-24 05:01:39 +08:00
committed by GitHub
parent 555191a3f0
commit 2df633180a
86 changed files with 276 additions and 255 deletions

View File

@@ -143,6 +143,7 @@ proc reversed*[T](a: openArray[T]): seq[T] {.inline.} =
runnableExamples:
assert [10, 11, 12].reversed == @[12, 11, 10]
assert seq[string].default.reversed == @[]
result = @[]
let n = a.len
result.setLen(n)
for i in 0..<n: result[i] = a[n - (i + 1)]