Skip to content

Commit

Permalink
[backport] fix nim-lang#11440, add docs to isNil for seq types needin…
Browse files Browse the repository at this point in the history
…g nilseq (nim-lang#13234) [ci skip]
  • Loading branch information
D-Nice authored and narimiran committed Jan 23, 2020
1 parent 4a754ff commit f12bea1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1494,8 +1494,20 @@ else:
{.pragma: nilError.}

proc isNil*[T](x: seq[T]): bool {.noSideEffect, magic: "IsNil", nilError.}
## Requires `--nilseqs:on` since 0.19.
##
## Seqs are no longer nil by default, but set and empty.
## Check for zero length instead.
##
## See also:
## * `isNil(string) <#isNil,string>`_

proc isNil*[T](x: ref T): bool {.noSideEffect, magic: "IsNil".}
proc isNil*(x: string): bool {.noSideEffect, magic: "IsNil", nilError.}
## Requires `--nilseqs:on`.
##
## See also:
## * `isNil(seq[T]) <#isNil,seq[T][T]>`_

proc isNil*[T](x: ptr T): bool {.noSideEffect, magic: "IsNil".}
proc isNil*(x: pointer): bool {.noSideEffect, magic: "IsNil".}
Expand Down

0 comments on commit f12bea1

Please sign in to comment.