tfinallyerrmsg.nim 474 B

1234567891011121314151617181920
  1. discard """
  2. cmd: "nim check $file"
  3. """
  4. block: # issue #19672
  5. try:
  6. 10 #[tt.Error
  7. ^ expression '10' is of type 'int literal(10)' and has to be used (or discarded); start of expression here: tfinallyerrmsg.nim(5, 1)]#
  8. finally:
  9. echo "Finally block"
  10. block: # issue #13871
  11. template t(body: int) =
  12. try:
  13. body
  14. finally:
  15. echo "expression"
  16. t: 2 #[tt.Error
  17. ^ expression '2' is of type 'int literal(2)' and has to be used (or discarded)]#