Closed saem closed 2 months ago
/merge
Merge requested by: @saem
Contents after the first section break of the PR description has been removed and preserved below:
## Notes for Reviewers * it's cleaner than I thought * let me know if there is a better module to use than `ast_query`, `trees` didn't seem right
Summary
No-return analysis ensures that nested final expressions (
block/case/if/try
) are accounted for no-return itself.Details
Prior to this change if the last expression within a greater expression was a no-return expression it would not be deemed as such if it was a
block/case/if/try
, instead errors would be raised related to discard checks or that path not resulting in the correct type.For example, the following would result in an error where
0
must be used or discarded:Fixes https://github.com/nim-works/nimskull/issues/1440