fixes #20303; wasMoved expressions with side effects
This commit is contained in:
parent
f433d9cccf
commit
bbbfde7341
2 changed files with 38 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
discard """
|
||||
targets: "c cpp"
|
||||
matrix: "--mm:arc; --mm:orc"
|
||||
"""
|
||||
|
||||
|
|
@ -20,3 +21,15 @@ block:
|
|||
|
||||
let keys = initKeyPair()
|
||||
doAssert keys.public[0] == 88
|
||||
|
||||
|
||||
template minIndexByIt: untyped =
|
||||
var other = 3
|
||||
other
|
||||
|
||||
proc bug20303() =
|
||||
var hlibs = @["hello", "world", "how", "are", "you"]
|
||||
let res = hlibs[minIndexByIt()]
|
||||
doAssert res == "are"
|
||||
|
||||
bug20303()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue