Files
Nim/compiler
metagn 44d2472b08 consider generic param type as typedesc in tuple type expressions (#25316)
fixes #25312

Tuple expressions `(a, b, c)` can be either types or values depending on
if their elements are typedescs or values, this is checked by checking
if the type of the element is `tyTypeDesc`. However when an
`skGenericParam` symbol is semchecked by `semSym` it is given its own
`tyGenericParam` type rather than a `tyTypeDesc` type, this seems to be
necessary for signatures to allow wildcard generic params passed to
static constrained generic params (tested in #25315). The reason
`semSym` is called is that `semGeneric` for generic invocations calls
`matches` which sems its arguments like normal expressions.

To deal with this, an expression of type `tyGenericParam` and with a
`skGenericParam` sym is allowed as a type in the tuple expression. A
problem is that this might consider a value with a wildcard generic
param type as a type. But this is a very niche problem, and I'm not sure
how to check for this. `skGenericParam` symbols stay as idents when
semchecked so it can't be checked that the node is an `skGenericParam`
symbol. It could be checked that it's an ident but I don't know how
robust this is. And maybe there is another way to refer to a wildcard
generic param type instead of just its symbol, i.e. another kind of
node.

This also makes #5647 finally work but a test case for that can be added
after.
2025-12-09 09:45:37 +01:00
..
2025-11-13 21:31:24 +01:00
2023-12-15 10:20:57 +01:00
2025-12-07 13:07:44 +01:00
2025-12-06 11:45:01 +01:00
2025-12-01 22:59:12 +01:00
2025-12-06 11:45:01 +01:00
2025-12-01 22:59:12 +01:00
2025-12-07 13:07:44 +01:00
2025-11-27 10:09:52 +01:00
2025-12-07 13:07:44 +01:00
2025-12-01 22:59:12 +01:00
2025-11-25 12:49:23 +01:00
2025-11-13 21:31:24 +01:00
2025-12-05 15:27:38 +01:00
2025-12-06 11:45:01 +01:00
2017-01-07 22:35:09 +01:00
2025-12-06 11:45:01 +01:00
2025-05-11 06:40:46 +02:00
2025-11-25 12:49:23 +01:00
2024-12-27 19:42:18 +01:00
2025-12-06 11:45:01 +01:00
2021-01-12 09:36:51 +01:00
2025-12-07 13:07:44 +01:00
2025-12-07 13:07:44 +01:00
2025-12-06 11:45:01 +01:00
2025-12-07 13:07:44 +01:00
2025-12-07 13:07:44 +01:00
2025-11-13 21:31:24 +01:00
2025-12-06 11:45:01 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2025-11-13 21:31:24 +01:00
2025-12-06 11:45:01 +01:00
2025-09-18 19:44:39 +02:00
2025-11-25 12:49:23 +01:00
2025-11-25 12:49:23 +01:00
2024-03-16 08:35:18 +08:00
2025-11-13 21:31:24 +01:00
2025-11-13 21:31:24 +01:00
2025-08-27 12:23:04 +02:00
2025-11-13 21:31:24 +01:00
2025-11-13 21:31:24 +01:00
2025-11-12 19:04:21 +01:00
2025-11-13 21:31:24 +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.