diff options
author | Danil Yarantsev <tiberiumk12@gmail.com> | 2020-10-19 14:16:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 13:16:56 +0200 |
commit | d22ab0fb9688f4322ba438af88927b414f3a898c (patch) | |
tree | 6945eb8237f7421275b1ac3a9fafecacae714005 | |
parent | b4c3bcd03742bdb51a3440cf285f85810ce2684c (diff) | |
download | Nim-d22ab0fb9688f4322ba438af88927b414f3a898c.tar.gz |
Add tests to #15363 (#15633)
-rw-r--r-- | tests/vm/tvmmisc.nim | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim index 7ac75c7c5..73faac495 100644 --- a/tests/vm/tvmmisc.nim +++ b/tests/vm/tvmmisc.nim @@ -204,3 +204,29 @@ block: # bug #13081 doAssert j1.x1 == 12 static: doAssert j1.x1 == 12 + +# bug #15363 +import sequtils + +block: + func identity(a: bool): bool = a + + var a: seq[bool] = static: + newSeq[bool](0).mapIt(it) # segfaults + var b: seq[bool] = static: + newSeq[bool](0).filterIt(it) # does not segfault + var c: seq[bool] = static: + newSeq[bool](0).map(identity) # does not segfault + var d: seq[bool] = static: + newSeq[bool](0).map(proc (a: bool): bool = false) # segfaults + var e: seq[bool] = static: + newSeq[bool](0).filter(identity) # does not segfault + var f: seq[bool] = static: + newSeq[bool](0).filter(proc (a: bool): bool = false) # segfaults + + doAssert a == @[] + doAssert b == @[] + doAssert c == @[] + doAssert d == @[] + doAssert e == @[] + doAssert f == @[] |