Files
Nim/tests/ic
Ryan McConnell 33ee586913 fixes #11797; fix C type hashes for imported aliases (#26150)
Fixes #11797.

Imported scalar and pointer aliases inherit their external C spelling,
but
receive a different Nim symbol. Signature hashing previously used that
symbol
identity, so aliases that emit exactly the same C type could produce
different
  backend names for tuples, sequences, and other generic types.

  For example, `cint` and `type CIntAlias = cint` both emit `int`, but
`seq[cint]` and `seq[CIntAlias]` could be emitted as incompatible C
structs.
The Nim type checker nevertheless permits assignments and calls between
them,
  causing the generated C or C++ compilation to fail.

This changes the backend hash to use the external type spelling when
available.
A symbol-based fallback remains for imported types without a resolved
spelling.

The change deliberately does not collapse imported types into their
underlying
Nim builtin. Types such as `pid_t`, imported pointers with qualifiers,
and
  platform typedefs may require distinct backend representations.

  ## NIF and incremental compilation

This does not change NIF serialization, NIF type keys, or the IC cache
format.
The bug is in backend type-name generation. An IC regression test is
included
to ensure that the corrected backend identity is preserved when
compilation
  passes through the NIF pipeline.

  ## Tests

  The regressions cover:

- tuple and sequence assignments between an imported type and its alias
  - cross-module sequence parameters and mutation
  - C and C++ backends
  - NIF-backed incremental compilation

  Existing C-type tests were also run under C/C++, refc, and ARC.

  ## Remaining scope

This does not solve the broader question of compatibility between
imported and
  builtin types that have different backend identities, such as
  `seq[cdouble]` and `seq[float]`. That remains tracked by #19374.
2026-08-28 22:33:20 +02:00
..
2026-06-15 23:33:16 +02:00
2026-06-15 23:33:16 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-15 23:33:16 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-07-10 14:07:35 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-06-15 23:33:16 +02:00
2026-08-27 19:35:11 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-08-27 19:35:11 +02:00
2026-08-27 19:35:11 +02:00
2021-03-19 16:53:38 +01:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-07-03 15:52:41 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00
2026-01-24 06:07:41 +01:00
2026-06-15 23:33:16 +02:00
2026-07-10 14:07:35 +02:00
2026-06-25 23:20:34 +02:00
2026-06-25 23:20:34 +02:00