summary refs log tree commit diff stats
path: root/lib/system
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-05-27 15:33:17 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-05-27 21:29:02 +0200
commit383147f5cb3db55cde451902d2c11c5cee9df075 (patch)
tree76e0b59505b53bbed4b4f69921128c45718d5c18 /lib/system
parent49e686ab4e8103173ecb39cc16896eb979ddf9ce (diff)
downloadNim-383147f5cb3db55cde451902d2c11c5cee9df075.tar.gz
make json.to work with the more restricted case objects
Diffstat (limited to 'lib/system')
-rw-r--r--lib/system/assign.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/system/assign.nim b/lib/system/assign.nim
index fd6a0ac56..e5ca1637c 100644
--- a/lib/system/assign.nim
+++ b/lib/system/assign.nim
@@ -224,14 +224,14 @@ proc selectBranch(discVal, L: int,
                   a: ptr array[0x7fff, ptr TNimNode]): ptr TNimNode =
   result = a[L] # a[L] contains the ``else`` part (but may be nil)
   if discVal <% L:
-    var x = a[discVal]
+    let x = a[discVal]
     if x != nil: result = x
 
 proc FieldDiscriminantCheck(oldDiscVal, newDiscVal: int,
                             a: ptr array[0x7fff, ptr TNimNode],
                             L: int) {.compilerProc.} =
-  var oldBranch = selectBranch(oldDiscVal, L, a)
-  var newBranch = selectBranch(newDiscVal, L, a)
+  let oldBranch = selectBranch(oldDiscVal, L, a)
+  let newBranch = selectBranch(newDiscVal, L, a)
   when defined(nimOldCaseObjects):
     if newBranch != oldBranch and oldDiscVal != 0:
       sysFatal(FieldError, "assignment to discriminant changes object branch")