style usages part one (openarray => openArray) (#19321)

* style usages (openArray)

* revert doc changes
This commit is contained in:
flywind 2022-01-04 20:29:50 +08:00 • committed by GitHub
commit 9df195ef58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 76 additions and 76 deletions

View file

@ -3,7 +3,7 @@ discard """
errormsg: "wrong number of variables"
"""
iterator xclusters*[T](a: openarray[T]; s: static[int]): array[s, T] {.inline.} =
iterator xclusters*[T](a: openArray[T]; s: static[int]): array[s, T] {.inline.} =
var result: array[s, T] # iterators have no default result variable
var i = 0
while i < len(a):

View file

@ -6,7 +6,7 @@ import strscans, strutils
proc raiseTestException*() =
raise newException(Exception, "test")
proc matchStackTrace(actualEntries: openarray[StackTraceEntry], expected: string) =
proc matchStackTrace(actualEntries: openArray[StackTraceEntry], expected: string) =
var expectedEntries = newSeq[StackTraceEntry]()
var i = 0

View file

@ -132,12 +132,12 @@ block:
echo foo(fun)
block:
# bug #10285 Function signature don't match when inside seq/array/openarray
# bug #10285 Function signature don't match when inside seq/array/openArray
# Note: the error message now shows `closure` which helps debugging the issue
# out why it doesn't match
proc takesFunc(f: proc (x: int) {.gcsafe, locks: 0.}) =
echo "takes single Func"
proc takesFuncs(fs: openarray[proc (x: int) {.gcsafe, locks: 0.}]) =
proc takesFuncs(fs: openArray[proc (x: int) {.gcsafe, locks: 0.}]) =
echo "takes multiple Func"
takesFunc(proc (x: int) {.gcsafe, locks: 0.} = echo x) # works
takesFuncs([proc (x: int) {.gcsafe, locks: 0.} = echo x]) # fails