tisolate.nim 545 B

12345678910111213141516171819202122232425262728293031323334353637
  1. discard """
  2. errormsg: "expression cannot be isolated: select(a, b)"
  3. line: 34
  4. """
  5. import std / isolation
  6. import json, streams
  7. proc f(): seq[int] =
  8. @[1, 2, 3]
  9. type
  10. Node = ref object
  11. x: string
  12. proc g(): Node = nil
  13. proc select(a, b: Node): Node =
  14. a
  15. proc main =
  16. discard isolate f()
  17. discard isolate g()
  18. discard isolate select(Node(x: "a"), nil)
  19. discard isolate select(Node(x: "a"), Node(x: "b"))
  20. discard isolate parseJson(newFileStream("my.json"), "my.json")
  21. var a, b: Node
  22. discard isolate select(a, b)
  23. main()