tstrange.nim 323 B

1234567891011121314151617181920212223242526272829
  1. discard """
  2. output: '''
  3. hallo40
  4. 1
  5. 2
  6. '''
  7. """
  8. # test for extremely strange bug
  9. proc ack(x: int, y: int): int =
  10. if x != 0:
  11. if y != 5:
  12. return y
  13. return x
  14. return x+y
  15. proc gen[T](a: T) =
  16. write(stdout, a)
  17. gen("hallo")
  18. write(stdout, ack(5, 4))
  19. #OUT hallo4
  20. # bug #1442
  21. let h=3
  22. for x in 0 ..< h.int:
  23. echo x