changes how the now illegal 'string == nil' comparison is detected
This commit is contained in:
parent
94684488d6
commit
0da91aa744
5 changed files with 12 additions and 7 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue