summary refs log tree commit diff stats
path: root/lib/system.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-08-15 16:31:56 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-08-15 16:31:56 +0200
commit0da91aa744703b816b1a9fd64f36b0de23145331 (patch)
treeba1fd666152b23a4d3f62fda7f8a4521909c38af /lib/system.nim
parent94684488d61143b8012b8b97e9f48777985aad42 (diff)
downloadNim-0da91aa744703b816b1a9fd64f36b0de23145331.tar.gz
changes how the now illegal 'string == nil' comparison is detected
Diffstat (limited to 'lib/system.nim')
-rw-r--r--lib/system.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim
index c730167ed..0a721d940 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -4048,6 +4048,10 @@ proc `==`*(x, y: cstring): bool {.magic: "EqCString", noSideEffect,
   elif x.isNil or y.isNil: result = false
   else: result = strcmp(x, y) == 0
 
+when defined(nimNoNilSeqs2):
+  proc `==`*(x: string; y: type(nil)): bool {.error.} = discard
+  proc `==`*(x: type(nil); y: string): bool {.error.} = discard
+
 template closureScope*(body: untyped): untyped =
   ## Useful when creating a closure in a loop to capture local loop variables by
   ## their current iteration values. Example: