Files
Nim/compiler
ringabout a4a482b5ef fixes #25620; typekey skips incorrectly the base type of seqs etc. types for nim ic (#25621)
fixes #25620

This pull request includes a fix to the type key generation logic in the
compiler and updates to a test file to cover additional language
features. The most important changes are summarized below:

### Compiler logic fix

* In `compiler/typekeys.nim`, the `typeKey` procedure was updated to
iterate over all elements in `t.sonsImpl` starting from index 0 instead
of 1, ensuring that all type sons are considered during type key
generation.

### Test suite improvements

* The test file `tests/ic/tenum.nim` was renamed to
`tests/ic/tmiscs.nim`, and its output expectations were updated to
reflect the new test cases.
* Added new test cases to `tests/ic/tmiscs.nim` to cover sink and move
semantics, including the definition of a `BigObj` type and a `consume`
procedure that demonstrates moving and consuming large objects.

```nim
# Sink and move semantics
type
  BigObj = object
    data: seq[int]

proc consume(x: sink BigObj) =
  echo x.data.len

var b = BigObj(data: @[1, 2, 3, 4, 5])
consume(move b)
```

gives

```
error: passing 'tySequence__qwqHTkRvwhrRyENtudHQ7g' (aka 'struct tySequence__qwqHTkRvwhrRyENtudHQ7g') to parameter of incompatible type 'tySequence__cTyVHeHOWk5jStsToosJ8Q' (aka 'struct tySequence__cTyVHeHOWk5jStsToosJ8Q')
   84 |         eqdestroy___sysma2dyk_u75((*dest_p0).data);
```

follows up https://github.com/nim-lang/Nim/pull/25614
2026-03-20 07:07:26 +01:00
..
2023-12-15 10:20:57 +01:00
2025-12-01 22:59:12 +01:00
2026-02-10 13:21:35 +01:00
2026-02-10 13:21:35 +01:00
2026-02-10 13:21:35 +01:00
2025-12-11 18:22:38 +01:00
2026-03-16 16:56:18 +01:00
2025-12-31 13:33:57 +01:00
2017-01-07 22:35:09 +01:00
2026-02-10 13:21:35 +01:00
2026-03-13 17:00:57 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-03-07 15:10:01 +01:00
2025-11-25 12:49:23 +01:00
2024-12-27 19:42:18 +01:00
2025-12-11 18:22:38 +01:00
2025-12-31 13:33:57 +01:00
2026-02-23 13:39:55 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2021-01-12 09:36:51 +01:00
2026-01-09 13:10:04 +01:00
2026-02-10 13:21:35 +01:00
2025-12-29 13:52:22 +01:00
2025-12-11 18:22:38 +01:00
2026-01-07 13:45:26 +01:00
2025-12-11 18:22:38 +01:00
2026-01-24 06:07:41 +01:00
2026-02-10 13:21:35 +01:00
2023-07-02 22:36:05 +02:00
2026-01-24 06:07:41 +01:00
2023-11-06 18:33:28 +01:00
2026-02-10 13:21:35 +01:00
2026-02-10 13:21:35 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2026-02-23 13:39:55 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2025-12-11 18:22:38 +01:00
2024-03-16 08:35:18 +08:00
2026-02-10 13:21:35 +01:00
2025-12-29 13:52:22 +01:00
2025-12-31 13:33:57 +01:00
2026-02-10 13:21:35 +01: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.