summary refs log tree commit diff stats
path: root/tests/discard/tdiscardable.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #23775; injectdestructors now handles discardable statements (#23780)ringabout2024-07-021-0/+24
| | | fixes #23775
* fix noreturn/implicit discard check logic (#23681)metagn2024-06-051-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | fixes #10440, fixes #13871, fixes #14665, fixes #19672, fixes #23677 The false positive in #23677 was caused by behavior in `implicitlyDiscardable` where only the last node of `if`/`case`/`try` etc expressions were considered, as in the final node of the final branch (in this case `else`). To fix this we use the same iteration in `implicitlyDiscardable` that we use in `endsInNoReturn`, with the difference that for an `if`/`case`/`try` statement to be implicitly discardable, all of its branches must be implicitly discardable. `noreturn` calls are also considered implicitly discardable for this reason, otherwise stuff like `if true: discardableCall() else: error()` doesn't compile. However `endsInNoReturn` also had bugs, one where `finally` was considered in noreturn checking when it shouldn't, another where only `nkIfStmt` was checked and not `nkIfExpr`, and the node given for the error message was bad. So `endsInNoReturn` now skips over `skipForDiscardable` which no longer contains `nkIfStmt`/`nkCaseStmt`/`nkTryStmt`, stores the first encountered returning node in a var parameter for the error message, and handles `finally` and `nkIfExpr`. Fixing #23677 already broke a line in `syncio` so some package code might be affected.
* enforce void for nkWhileStmt [backport: 2.0] (#21170)ringabout2022-12-241-0/+11
| | | enforce void for nkWhileStmt
* fixes #13583; enforce void for `nkWhileStmt` (#20947)ringabout2022-11-291-0/+34
| | | | | * fixes #13583; enfore void for nkWhileStmt * one more case
* revert discardable transformation (#10905)Andreas Rumpf2019-04-211-0/+20
| | | | | | | | | | * Revert "Properly wrap discarded statements (#10322)" This reverts commit 15584879b91e14565156ca140eef1dc100cf34c4. * add test for implicit discard after defer * enable t10241 again * make C++ tests green again
* lots of small changesArne Döring2018-12-111-0/+3
|
* updated tests to be executedArne Döring2018-11-231-0/+7
|
* fix #9726 (#9765)Arne Döring2018-11-201-0/+8
|
* make tests green againAndreas Rumpf2018-07-051-1/+1
|
* Remove expr/stmt (#5857)Arne Döring2017-07-251-1/+1
|
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-2/+2
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* fixes #942Araq2014-03-051-0/+16
|
* new tester; all tests categorizedAraq2014-01-131-0/+13