fixes move analyser; refs #11257
This commit is contained in:
parent
981f95757c
commit
b75ad05267
2 changed files with 17 additions and 5 deletions
12
tests/destructor/tconsume_twice.nim
Normal file
12
tests/destructor/tconsume_twice.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
cmd: "nim c --newruntime $file"
|
||||
errormsg: "sink parameter `a` is already consumed at tconsume_twice.nim(8, 6)"
|
||||
line: 10
|
||||
"""
|
||||
|
||||
proc consumeTwice(a: owned proc()): owned proc() =
|
||||
if a == nil:
|
||||
return
|
||||
return a
|
||||
|
||||
assert consumeTwice(proc() = discard) != nil
|
||||
Loading…
Add table
Add a link
Reference in a new issue