summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndrii Riabushenko <cdome@bk.ru>2018-12-10 09:20:43 +0000
committerAndrii Riabushenko <cdome@bk.ru>2018-12-10 09:20:43 +0000
commitd22fa090000689c550a644c37aefc21ba4f0dba1 (patch)
tree6589d6a32416af9cfb1deddb02c1e6a52d6d038d
parent8b7f416c37d88599fd8fb9f88480584f191562de (diff)
downloadNim-d22fa090000689c550a644c37aefc21ba4f0dba1.tar.gz
minor correction
-rw-r--r--compiler/destroyer.nim3
1 files changed, 1 insertions, 2 deletions
diff --git a/compiler/destroyer.nim b/compiler/destroyer.nim
index 7d2bb7221..407204e51 100644
--- a/compiler/destroyer.nim
+++ b/compiler/destroyer.nim
@@ -367,8 +367,7 @@ proc destructiveMoveVar(n: PNode; c: var Con): PNode =
 
 proc sinkParamIsLastReadCheck(c: var Con, s: PNode) = 
   assert s.kind == nkSym and s.sym.kind == skParam
-  discard isLastRead(s, c)
-  if c.otherRead != nil:
+  if not isLastRead(s, c):
      localError(c.graph.config, c.otherRead.info, "sink parameter `" & $s.sym.name.s &
          "` is already consumed at " & toFileLineCol(c. graph.config, s.info))