diff options
author | metagn <metagngn@gmail.com> | 2024-09-08 21:17:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-08 20:17:26 +0200 |
commit | cd22560af5f13a7c024b97e2f3de2b1fe2439eb3 (patch) | |
tree | f9a0fe8a50c34a1d39711908b772b828e22731b4 /tests/arc | |
parent | 7cd17772181a8577a79ee166f4dc96b396dd59d2 (diff) | |
download | Nim-cd22560af5f13a7c024b97e2f3de2b1fe2439eb3.tar.gz |
fix string literal assignment with different lengths on ARC (#24083)
fixes #24080
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/tstringliteral.nim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/arc/tstringliteral.nim b/tests/arc/tstringliteral.nim new file mode 100644 index 000000000..c5fac22d8 --- /dev/null +++ b/tests/arc/tstringliteral.nim @@ -0,0 +1,17 @@ +discard """ + matrix: "--mm:arc; --mm:orc" +""" + +block: # issue #24080 + var a = (s: "a") + var b = "a" + a.s.setLen 0 + b = a.s + doAssert b == "" + +block: # issue #24080, longer string + var a = (s: "abc") + var b = "abc" + a.s.setLen 2 + b = a.s + doAssert b == "ab" |