Files
Nim/compiler
metagn 71c5a4f72c generate let _ = to fully unpack partial tuple unpacking assignment for arc (#24948)
fixes #24947

When injectdestructors detects that a variable is a tuple unpacking temp
(i.e. it is an `skTemp`, is not a cursor, and has tuple type) it does
not generate a destructor for it and only generates sink/bit assignments
for its components. However the reason it does not generate a destructor
is that it expects it to be fully unpacked, this is true for unpackings
in for loops but not for tuple unpacking assignments which supports `_`
since #22537. Tuple unpacking definitions for `var`/`let`/`const` do not
generate `skTemp` and use the same symbol kind as the definition so they
did not have this problem.

To keep this compatible, the `_` parts of the tuple unpacking
assignments are now not ignored and unpacked into `let _ = ...`, which
generates its own destructor. Another option might be to use `skLet`
instead of `skTemp` but this might cause changes to behavior like
additional copies, I am not sure about this though.
2025-05-15 09:32:10 +02:00
..
2023-12-15 10:20:57 +01:00
2017-01-07 22:35:09 +01:00
2025-05-11 06:40:46 +02:00
2024-12-27 19:42:18 +01:00
2023-12-13 10:29:58 +01:00
2021-01-12 09:36:51 +01:00
2024-07-09 09:29:45 +02:00
2024-10-29 08:01:44 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2025-05-06 09:46:45 +02:00
2025-04-10 09:24:19 +02:00
2024-03-16 08:35:18 +08:00
2025-04-16 12:11:33 +02:00
2023-12-25 07:12:54 +01:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.