tnon_disjoint_slice1.nim 432 B

1234567891011121314151617181920212223242526
  1. discard """
  2. errormsg: "cannot prove (i)..(i) disjoint from (i + 1)..(i + 1)"
  3. line: 20
  4. """
  5. import threadpool
  6. proc f(a: openArray[int]) =
  7. for x in a: echo x
  8. proc f(a: int) = echo a
  9. proc main() =
  10. var a: array[0..30, int]
  11. parallel:
  12. #spawn f(a[0..15])
  13. #spawn f(a[16..30])
  14. var i = 0
  15. while i <= 29:
  16. spawn f(a[i])
  17. spawn f(a[i+1])
  18. inc i
  19. #inc i # inc i, 2 would be correct here
  20. main()