t6612.nim 434 B

12345678910111213141516171819202122232425
  1. discard """
  2. action: "run"
  3. """
  4. proc fillWith(sq: var seq[int], n: int, unused: string) =
  5. sq = @[n]
  6. type
  7. Object = object of RootObj
  8. case hasNums: bool
  9. of true:
  10. numbers: seq[int]
  11. of false:
  12. discard
  13. always: seq[int]
  14. var obj = Object(hasNums: true)
  15. obj.always.fillWith(5, "unused")
  16. doAssert obj.always == @[5]
  17. obj.numbers.fillWith(3, "unused")
  18. doAssert obj.numbers == @[3]
  19. doAssert obj.always == @[5]