Files
Nim/tests/vm
metagn ea9811a4d2 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
2024-10-06 19:36:46 +02:00
..
2018-08-13 13:02:52 +02:00
2017-07-25 09:28:23 +02:00
2019-02-01 12:12:10 +01:00
2018-08-13 13:02:52 +02:00
2016-08-23 01:10:34 +02:00
2017-02-05 08:51:43 +01:00
2019-09-28 19:50:20 +02:00
2019-08-02 22:59:04 +01:00
2019-05-21 21:31:40 +02:00
2018-12-11 21:23:22 +01:00
2016-10-09 18:02:48 +02:00
2018-06-26 21:25:27 +02:00
2018-10-27 14:10:05 +01:00
2018-08-13 23:16:03 +02:00
2018-11-23 11:58:28 +01:00
2020-12-28 14:13:21 +01:00
2020-11-05 14:00:08 +01:00
2020-12-28 14:13:21 +01:00
2017-07-25 09:28:23 +02:00
2014-03-16 20:42:49 +02:00