t1641.nim 249 B

123456789101112131415161718192021
  1. discard """
  2. output: '''foo 0
  3. bar 0
  4. baz'''
  5. """
  6. # bug #1641
  7. proc baz() =
  8. echo "baz"
  9. proc bar(x: int, p: proc()) =
  10. echo "bar ", x
  11. p()
  12. proc foo(x: int, p: proc(x: int)) =
  13. echo "foo ", x
  14. p(x)
  15. let x = 0
  16. x.foo do(x: int): x.bar do(): baz()