I've bumped into the following subtlety and was wondering if anyone could help me clarify it. Why does the following fails to compile: proc aProc*(): int = try: 1 except Exception as exc: echo "oops" # Fails with "Error: expression '1' is of type 'int' and has to be used (or discarded)" Run
but this doesn't: proc aProc*(): int = try: return 1 except Exception as exc: echo "oops" # prints 1 Run and neither does this? proc aProc*(): int = try: 1 except Exception as exc: 2 # prints 1 Run