fixes #20303; wasMoved expressions with side effects for ORC (#20307) [backport]

fixes #20303; wasMoved expressions with side effects
This commit is contained in:
ringabout
2022-09-08 14:07:28 +08:00
committed by GitHub
parent f433d9cccf
commit bbbfde7341
2 changed files with 38 additions and 2 deletions

View File

@@ -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()