tccgissues.nim 950 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. discard """
  2. output: '''
  3. @[1, 2, 3, 4]
  4. '''
  5. """
  6. # issue #10999
  7. proc varargsToSeq(vals: varargs[int32]): seq[int32] =
  8. result = newSeqOfCap[int32](vals.len)
  9. for v in vals:
  10. result.add v
  11. echo varargsToSeq(1, 2, 3, 4)
  12. type # bug #16845
  13. MyObjectKind = enum
  14. SomeKind
  15. block:
  16. type
  17. MyObject = ref object
  18. case kind: MyObjectKind:
  19. of SomeKind:
  20. c: string
  21. var obj = MyObject(kind:SomeKind)
  22. obj.c = "some string"
  23. block:
  24. type
  25. MyObject = ref object
  26. kind: MyObjectKind
  27. c: string
  28. var obj = MyObject(kind:SomeKind)
  29. obj.c = "some string"
  30. block:
  31. type
  32. MyBaseObj[T] = object of RootObj
  33. test: seq[T]
  34. MyObj = object
  35. attr: MyBaseObj[string]
  36. var myObj: MyObj
  37. block:
  38. type
  39. MyBaseAttrObj[T] = object of RootObj
  40. test: seq[T]
  41. MyBaseObj[T] = object of RootObj
  42. myBaseObj: MyBaseAttrObj[T]
  43. MyObj = object
  44. attr: MyBaseObj[string]
  45. var myObj: MyObj