tescaping_temps.nim 641 B

1234567891011121314151617181920212223242526272829303132
  1. # bug #4505
  2. proc f(t: tuple[]) = discard
  3. f((block: ()))
  4. # bug #4230
  5. # If we make `test` function return nothing - the bug disappears
  6. proc test(dothejob: proc()): int {.discardable.} =
  7. dothejob()
  8. test proc() =
  9. let f = 15
  10. if f > 10:
  11. test proc() = discard
  12. # If we remove elif branch of the condition - the bug disappears
  13. elif f < 3:
  14. test proc() = discard
  15. else:
  16. test proc() = discard
  17. # ensure 'case' does not trigger the same bug:
  18. test proc() =
  19. let f = 15
  20. case f
  21. of 10:
  22. test proc() = discard
  23. of 3:
  24. test proc() = discard
  25. else:
  26. test proc() = discard