tmalloc.nim 255 B

1234567891011121314151617
  1. discard """
  2. matrix: "--mm:arc -d:useMalloc; --mm:arc"
  3. """
  4. block: # bug #22058
  5. template foo(): auto =
  6. {.noSideEffect.}:
  7. newSeq[byte](1)
  8. type V = object
  9. v: seq[byte]
  10. proc bar(): V =
  11. V(v: foo())
  12. doAssert bar().v == @[byte(0)]