From 0da91aa744703b816b1a9fd64f36b0de23145331 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 15 Aug 2018 16:31:56 +0200 Subject: changes how the now illegal 'string == nil' comparison is detected --- lib/system.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') 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: -- cgit 1.4.1-2-gfad0