attempt to fix #16374 (#17232)

* remove unnecessary when statement

* remove outdated codes

* attempt to fix #16374

* fix
This commit is contained in:
flywind 2021-03-02 19:41:55 +08:00 • committed by GitHub
commit 5628cd5de1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 1 deletions

38
tests/ccgbugs/t16374.nim Normal file
View file

@ -0,0 +1,38 @@
discard """
matrix: "--gc:refc; --gc:orc"
"""
block:
iterator mvalues(t: var seq[seq[int]]): var seq[int] =
yield t[0]
var t: seq[seq[int]]
while false:
for v in t.mvalues:
discard
proc ok =
while false:
for v in t.mvalues:
discard
ok()
block:
iterator mvalues(t: var seq[seq[int]]): lent seq[int] =
yield t[0]
var t: seq[seq[int]]
while false:
for v in t.mvalues:
discard
proc ok =
while false:
for v in t.mvalues:
discard
ok()