metagn
4acc7a5e18
reset inTypeofContext in generic instantiations ( #24229 )
...
fixes #24228 , refs #22022
As described in
https://github.com/nim-lang/Nim/issues/24228#issuecomment-2392462221 ,
instantiating generic routines inside `typeof` causes all code inside to
be treated as being in a typeof context, and thus preventing compile
time proc folding, causing issues when code is generated for the
instantiated routine. Now, instantiated generic procs are treated as
never being inside a `typeof` context.
This is probably an arbitrary special case and more issues with the
`typeof` behavior from #22022 are likely. Ideally this behavior would be
removed but it's necessary to accomodate the current [proc `declval` in
the package `stew`](https://github.com/status-im/nim-stew/pull/190 ), at
least without changes to `compileTime` that would either break other
code (making it not eagerly fold by default) or still require a change
in stew (adding an option to disable the eager folding).
Alternatively we could also make the eager folding opt-in only for
generic compileTime procs so that #22022 breaks nothing whatsoever, but
a universal solution would be better. Edit: Done in #24230 via
experimental switch
(cherry picked from commit ea9811a4d2 )
2024-10-23 08:12:50 +02:00
..
2024-08-14 09:36:57 +02:00
2023-04-24 06:52:37 +02:00
2022-11-16 07:36:14 +01:00
2022-09-11 13:52:43 -04:00
2024-09-28 08:18:28 +02:00
2022-12-26 13:20:05 +01:00
2024-05-21 18:51:03 +02:00
2023-02-22 20:34:20 +01:00
2022-03-23 20:34:53 +01:00
2023-05-08 16:25:47 +02:00
2024-09-13 11:09:04 +02:00
2024-09-13 11:09:45 +02:00
2022-09-28 15:05:01 +02:00
2022-11-30 21:51:13 +01:00
2024-01-19 09:18:23 +01:00
2024-04-18 09:00:35 +02:00
2022-09-27 10:57:47 +02:00
2022-09-27 10:57:47 +02:00
2024-06-26 18:50:37 +02:00
2024-06-07 15:34:34 +02:00
2024-09-13 10:22:30 +02:00
2024-05-21 14:52:29 +02:00
2024-04-18 10:30:34 +02:00
2023-07-22 06:37:27 +02:00
2024-05-21 14:52:30 +02:00
2024-04-18 09:00:46 +02:00
2023-06-18 16:06:14 +02:00
2024-05-21 14:52:29 +02:00
2024-09-18 19:36:30 +02:00
2017-01-07 22:35:09 +01:00
2022-06-10 20:40:08 +02:00
2023-07-14 12:40:24 +02:00
2023-06-27 22:42:48 +02:00
2023-07-20 19:56:04 +02:00
2024-08-14 09:36:57 +02:00
2023-04-24 06:52:37 +02:00
2022-03-23 20:34:53 +01:00
2022-12-16 08:01:15 +01:00
2024-06-24 08:28:29 +02:00
2024-04-18 09:00:35 +02:00
2021-09-25 13:22:00 +02:00
2019-11-28 17:13:04 +01:00
2023-05-02 10:49:17 +02:00
2022-10-21 22:46:32 +02:00
2023-09-18 12:12:59 +02:00
2022-03-23 20:34:53 +01:00
2024-05-21 14:17:58 +02:00
2020-06-01 19:21:41 +02:00
2024-09-30 18:29:19 +02:00
2024-05-23 13:55:23 +02:00
2023-02-24 09:02:15 +01:00
2023-05-14 16:58:28 +02:00
2024-05-24 15:57:15 +02:00
2023-02-27 00:56:43 +01:00
2024-05-22 09:28:21 +02:00
2023-05-06 21:27:28 +02:00
2023-05-11 10:10:51 +02:00
2024-07-09 20:09:41 +02:00
2021-03-09 20:19:24 +01:00
2024-09-16 16:29:37 +02:00
2024-10-11 14:19:38 +02:00
2022-03-23 20:34:53 +01:00
2024-09-16 16:29:37 +02:00
2024-04-17 14:00:45 +02:00
2021-01-12 09:36:51 +01:00
2023-05-12 10:05:38 +02:00
2024-02-01 12:30:21 +01:00
2024-02-01 12:30:21 +01:00
2024-04-19 16:39:22 +02:00
2024-02-01 12:30:21 +01:00
2024-05-21 18:51:04 +02:00
2022-03-23 20:34:53 +01:00
2023-04-24 06:52:37 +02:00
2024-07-09 20:09:41 +02:00
2023-05-11 10:23:52 +02:00
2023-05-02 10:49:17 +02:00
2022-03-26 11:50:15 +01:00
2023-06-30 23:03:25 +02:00
2022-03-23 20:34:53 +01:00
2022-09-11 13:52:43 -04:00
2022-03-23 20:34:53 +01:00
2023-03-08 22:34:59 +01:00
2023-04-17 20:55:22 +02:00
2023-05-12 15:24:14 +02:00
2024-09-18 19:36:30 +02:00
2022-05-30 18:52:19 +02:00
2024-10-11 14:19:38 +02:00
2024-09-13 11:09:35 +02:00
2024-04-19 16:35:07 +02:00
2022-08-24 09:44:16 +02:00
2023-05-02 10:49:17 +02:00
2023-03-02 09:16:28 +01:00
2022-10-17 23:48:51 +02:00
2024-02-01 12:30:21 +01:00
2023-03-03 07:36:38 +01:00
2023-02-16 13:47:52 +01:00
2018-05-27 19:19:12 +02:00
2024-07-08 11:17:49 +02:00
2020-11-25 07:48:27 +01:00
2020-09-22 18:24:13 +02:00
2023-07-02 22:36:05 +02:00
2024-08-14 09:36:57 +02:00
2022-08-09 16:32:29 +08:00
2024-09-08 08:42:53 +02:00
2022-08-24 13:38:30 +02:00
2023-05-30 13:41:56 +02:00
2020-09-11 01:04:07 +02:00
2023-07-03 14:15:44 +02:00
2024-10-08 16:32:20 +02:00
2024-10-08 16:32:20 +02:00
2024-09-13 13:43:23 +02:00
2024-10-08 16:32:20 +02:00
2023-04-24 06:52:37 +02:00
2024-09-17 13:43:10 +02:00
2024-09-18 19:36:30 +02:00
2024-10-23 08:12:50 +02:00
2022-10-22 06:37:23 +02:00
2024-09-28 08:18:04 +02:00
2024-05-21 18:51:03 +02:00
2023-04-24 06:52:37 +02:00
2024-09-18 19:27:51 +02:00
2024-08-31 13:50:28 +02:00
2022-12-11 16:58:50 +01:00
2024-09-18 19:36:30 +02:00
2024-09-30 18:24:24 +02:00
2024-09-13 11:09:24 +02:00
2023-05-02 10:49:17 +02:00
2024-10-08 16:32:20 +02:00
2022-12-10 15:42:22 +01:00
2024-04-17 16:02:18 +02:00
2024-05-21 14:52:29 +02:00
2024-06-04 07:38:38 +02:00
2024-05-23 08:59:09 +02:00
2022-04-25 12:00:23 +02:00
2022-08-19 15:40:53 -04:00
2024-07-02 06:06:13 +02:00
2024-04-17 12:40:00 +02:00
2022-03-23 20:34:53 +01:00
2024-05-23 08:56:53 +02:00
2024-10-05 18:42:54 +02:00
2023-04-11 09:23:41 +02:00
2024-08-31 13:51:52 +02:00
2024-08-19 09:23:43 +02:00
2022-12-10 18:57:19 +01:00
2023-09-18 12:12:58 +02:00
2024-04-17 14:06:46 +02:00
2024-04-22 10:22:28 +02:00
2023-06-17 05:42:05 +02:00
2023-04-24 06:52:37 +02:00
2023-06-17 05:42:05 +02:00
2023-05-04 15:44:46 +08:00
2024-04-17 12:40:00 +02:00