diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-08-15 16:31:56 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-08-15 16:31:56 +0200 |
commit | 0da91aa744703b816b1a9fd64f36b0de23145331 (patch) | |
tree | ba1fd666152b23a4d3f62fda7f8a4521909c38af /lib/system.nim | |
parent | 94684488d61143b8012b8b97e9f48777985aad42 (diff) | |
download | Nim-0da91aa744703b816b1a9fd64f36b0de23145331.tar.gz |
changes how the now illegal 'string == nil' comparison is detected
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 4 |
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: |