diff options
author | D-Nice <d-nice2@protonmail.com> | 2020-01-23 01:51:53 -0500 |
---|---|---|
committer | Miran <narimiran@disroot.org> | 2020-01-23 07:51:53 +0100 |
commit | f12bea16ad968f10ffe97591ac789ddc36984962 (patch) | |
tree | 60fa0f8a271769abc40f8861fcd543a8b389b53b /lib | |
parent | 4a754ff392920acde4392ad3ec2040dc3e80bea9 (diff) | |
download | Nim-f12bea16ad968f10ffe97591ac789ddc36984962.tar.gz |
[backport] fix #11440, add docs to isNil for seq types needing nilseq (#13234) [ci skip]
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index c92d5c64a..a32995350 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -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".} |