metagn
42e8472ca6
fix noreturn/implicit discard check logic ( #23681 )
...
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.
2024-06-05 20:53:05 +02:00
..
2023-12-18 17:40:30 +01:00
2024-05-08 09:11:46 -06:00
2024-03-18 20:27:00 +01:00
2023-08-06 14:26:21 +02:00
2023-12-15 10:20:57 +01:00
2024-05-08 09:11:46 -06:00
2024-04-10 14:41:16 +02:00
2024-04-16 12:46:59 +02:00
2023-12-17 18:43:52 +01:00
2023-02-22 20:34:20 +01:00
2023-10-11 17:44:14 +02:00
2023-08-06 14:26:21 +02:00
2024-06-02 15:16:44 +02:00
2024-05-21 14:53:08 +02:00
2022-09-28 15:05:01 +02:00
2022-11-30 21:51:13 +01:00
2024-01-18 14:40:22 +01:00
2024-06-02 15:15:03 +02:00
2022-09-27 10:57:47 +02:00
2023-12-15 10:20:57 +01:00
2024-06-02 15:15:03 +02:00
2024-05-07 15:03:53 -06:00
2024-06-02 15:15:03 +02:00
2024-03-16 08:35:18 +08:00
2024-03-03 16:04:24 +01:00
2024-04-18 18:52:30 +02:00
2024-03-28 11:04:12 +01:00
2023-11-20 21:12:13 +01:00
2023-06-18 16:06:14 +02:00
2024-03-16 08:35:18 +08:00
2023-12-17 12:29:46 +01:00
2017-01-07 22:35:09 +01:00
2022-06-10 20:40:08 +02:00
2023-10-29 14:48:11 +01:00
2024-04-22 13:04:30 +02:00
2023-08-06 14:26:21 +02:00
2023-12-23 09:22:49 +01:00
2023-12-17 18:43:52 +01:00
2023-11-20 21:12:13 +01:00
2024-04-10 14:41:16 +02:00
2024-03-14 19:23:18 +01:00
2023-12-15 10:20:57 +01:00
2024-01-31 21:36:59 +01:00
2023-10-29 14:48:11 +01:00
2023-10-29 14:48:11 +01:00
2023-10-29 14:48:11 +01:00
2023-12-15 08:13:25 +01:00
2023-09-01 06:41:39 +02:00
2023-10-29 14:48:11 +01:00
2024-04-10 14:41:16 +02:00
2020-06-01 19:21:41 +02:00
2024-04-24 12:47:05 +02:00
2024-06-04 09:50:35 +02:00
2023-12-15 08:13:25 +01:00
2023-12-14 16:25:34 +01:00
2024-06-02 15:15:31 +02:00
2023-12-13 10:29:58 +01:00
2024-04-26 19:00:25 +08:00
2023-12-13 10:39:10 +01:00
2023-12-15 08:13:25 +01:00
2024-05-15 20:52:18 +02:00
2023-10-29 14:48:11 +01:00
2024-06-02 15:15:03 +02:00
2023-08-06 14:26:21 +02:00
2023-11-04 17:46:59 +08:00
2024-04-10 14:41:16 +02:00
2023-12-13 10:29:58 +01:00
2021-01-12 09:36:51 +01:00
2023-12-12 16:54:50 +01:00
2024-04-10 14:41:16 +02:00
2024-04-05 08:54:48 +02:00
2024-04-10 14:41:16 +02:00
2024-01-05 08:17:08 +01:00
2024-01-31 21:36:59 +01:00
2024-04-22 13:55:14 +02:00
2022-03-23 20:34:53 +01:00
2023-12-16 07:05:57 +01:00
2023-11-30 14:05:45 +01:00
2023-12-14 17:04:09 +01:00
2023-12-15 08:13:25 +01:00
2023-12-15 08:13:25 +01:00
2024-04-10 14:41:16 +02:00
2023-10-29 14:48:11 +01:00
2023-10-29 14:48:11 +01:00
2023-12-12 16:54:50 +01:00
2023-10-29 14:48:11 +01:00
2024-03-18 20:27:00 +01:00
2023-04-17 20:55:22 +02:00
2024-04-10 14:41:16 +02:00
2024-03-15 18:20:10 +01:00
2023-08-06 14:26:21 +02:00
2023-04-24 06:52:37 +02:00
2023-10-29 14:48:11 +01:00
2024-03-18 20:27:00 +01:00
2022-08-24 09:44:16 +02:00
2023-11-20 21:12:13 +01:00
2023-10-29 14:48:11 +01:00
2023-12-17 18:43:52 +01:00
2024-04-10 14:41:16 +02:00
2023-03-03 07:36:38 +01:00
2023-10-29 14:48:11 +01:00
2018-05-27 19:19:12 +02:00
2024-05-10 10:35:23 +02:00
2023-10-29 14:48:11 +01:00
2024-04-10 14:41:16 +02:00
2023-07-02 22:36:05 +02:00
2023-12-24 15:22:10 +01:00
2023-10-29 14:48:11 +01:00
2024-04-10 14:41:16 +02:00
2023-11-06 18:33:28 +01:00
2023-08-10 14:26:40 +02:00
2020-09-11 01:04:07 +02:00
2023-10-29 14:48:11 +01:00
2024-06-05 20:53:05 +02:00
2024-04-10 14:41:16 +02:00
2024-03-14 19:23:18 +01:00
2024-06-04 09:43:12 +02:00
2023-12-15 08:13:25 +01:00
2024-04-09 14:39:14 +02:00
2024-04-10 14:41:16 +02:00
2024-03-14 19:23:18 +01:00
2023-12-15 10:20:57 +01:00
2024-05-23 20:15:20 +02:00
2024-04-16 12:46:59 +02:00
2023-12-15 08:13:25 +01:00
2024-04-10 14:41:16 +02:00
2024-06-05 20:53:05 +02:00
2022-12-11 16:58:50 +01:00
2024-04-10 14:41:16 +02:00
2024-05-10 10:32:07 +02:00
2024-03-14 19:23:18 +01:00
2024-04-10 14:41:16 +02:00
2024-05-08 09:10:48 -06:00
2023-11-20 21:12:13 +01:00
2023-12-14 16:25:34 +01:00
2024-03-16 08:35:18 +08:00
2024-06-02 11:54:39 +02:00
2024-05-08 09:10:48 -06:00
2024-03-15 18:20:10 +01:00
2024-04-10 14:41:16 +02:00
2023-08-10 14:26:40 +02:00
2024-04-26 16:02:02 +02:00
2024-02-20 07:31:58 +01:00
2023-10-29 14:48:11 +01:00
2024-05-01 09:02:43 +02:00
2024-03-27 10:51:44 +01:00
2023-10-29 14:48:11 +01:00
2024-01-18 21:47:13 +01:00
2024-03-03 15:40:08 +01:00
2023-12-12 16:54:50 +01:00
2023-08-21 20:08:00 +02:00
2023-12-15 10:20:57 +01:00
2024-05-08 09:11:46 -06:00
2023-08-10 14:26:40 +02:00
2024-04-10 14:41:16 +02:00
2023-08-18 16:47:47 +02:00
2023-10-29 14:48:11 +01:00
2023-12-17 18:43:52 +01:00
2023-12-25 07:12:54 +01:00