tgenericassign.nim 455 B

12345678910111213141516171819202122232425
  1. discard """
  2. output: '''came here'''
  3. """
  4. type
  5. TAny* = object {.pure.}
  6. value*: pointer
  7. rawType: pointer
  8. proc newAny(value, rawType: pointer): TAny =
  9. result.value = value
  10. result.rawType = rawType
  11. var name: cstring = "example"
  12. var ret: seq[tuple[name: string, a: TAny]] = @[]
  13. for i in 0..8000:
  14. var tup = ($name, newAny(nil, nil))
  15. assert(tup[0] == "example")
  16. ret.add(tup)
  17. assert(ret[ret.len()-1][0] == "example")
  18. echo "came here"