diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2024-08-20 19:09:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-20 19:09:06 +0800 |
commit | 43274bfb9277999b8dcc205731f574c4b9924ac4 (patch) | |
tree | 84dcb12376d9cef688fca5aeaeaf93a89ab7f859 /tests/arc | |
parent | 26107e931cb846647bae3a7335d2ac1993dc4386 (diff) | |
download | Nim-43274bfb9277999b8dcc205731f574c4b9924ac4.tar.gz |
fixes #23982; codegen regression passing pointer expressions to inline iterators (#23986)
fixes #23982
Diffstat (limited to 'tests/arc')
-rw-r--r-- | tests/arc/titeration_doesnt_copy.nim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/arc/titeration_doesnt_copy.nim b/tests/arc/titeration_doesnt_copy.nim index e1cdb6166..e510a6eff 100644 --- a/tests/arc/titeration_doesnt_copy.nim +++ b/tests/arc/titeration_doesnt_copy.nim @@ -54,3 +54,14 @@ proc toBinString*(data: openArray[uint8], col: int): string = doAssert @[0b0000_1111'u8, 0b1010_1010].toBinString(8) == "0000111110101010" doAssert @[0b1000_0000'u8, 0b0000_0000].toBinString(1) == "10" + +block: # bug #23982 + iterator `..`(a, b: ptr int16): ptr int16 = discard + var a: seq[int16] #; let p = a[0].addr + var b: seq[ptr int16] + + try: + for x in a[0].addr .. b[1]: # `p .. b[1]` works + discard + except IndexDefect: + discard |