From 2e9d595f92ef541f1662e08f1fca1fa9cb19f132 Mon Sep 17 00:00:00 2001 From: D-Nice Date: Thu, 23 Jan 2020 01:51:53 -0500 Subject: [PATCH] [backport] fix #11440, add docs to isNil for seq types needing nilseq (#13234) [ci skip] (cherry picked from commit f12bea16ad968f10ffe97591ac789ddc36984962) --- lib/system.nim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/system.nim b/lib/system.nim index e6e3dc0ab8..ba26ceea2a 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -2931,8 +2931,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".}