t6483.nim 652 B

12345678910111213141516171819202122232425262728293031
  1. discard """
  2. errormsg: "request to generate code for .compileTime proc: newSeq"
  3. line: 21
  4. """
  5. type
  6. VarItem = object
  7. onode: NimNode
  8. nnode: NimNode
  9. suffix: string
  10. VarState = object
  11. scopes: seq[VarScope]
  12. VarScope = object
  13. variables: seq[VarItem]
  14. children: seq[VarScope]
  15. when isMainModule:
  16. var scope1 = VarScope(
  17. variables: newSeq[VarItem](),
  18. children: newSeq[VarScope]()
  19. )
  20. var scope2 = VarScope(
  21. variables: newSeq[VarItem](),
  22. children: newSeq[VarScope]()
  23. )
  24. var state = VarState(scopes: newSeq[VarScope]())
  25. state.scopes.add(scope1)
  26. state.scopes[0].children.add(scope2)
  27. echo($state.scopes)