summary refs log tree commit diff stats
path: root/compiler/destroyer.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/destroyer.nim')
-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))