diff options
Diffstat (limited to 'tests/lent/tnot_allowed_lent2.nim')
-rw-r--r-- | tests/lent/tnot_allowed_lent2.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/lent/tnot_allowed_lent2.nim b/tests/lent/tnot_allowed_lent2.nim new file mode 100644 index 000000000..d0c958df3 --- /dev/null +++ b/tests/lent/tnot_allowed_lent2.nim @@ -0,0 +1,14 @@ +discard """ + errormsg: "'x' cannot be assigned to" + line: 10 +""" + +proc bug14498 = + var a = @['a', 'b', 'c', 'd', 'e', 'f'] + + for x in a: + x = 'c' + + echo a + +bug14498() |