Files
Nim/tests/metatype
metagn 2499336fef remove prev == nil requirement for typedesc params as type nodes (#24206)
fixes #24203

`semTypeNode` is called twice for RHS'es of type sections,
[here](b0e6d28782/compiler/semstmts.nim (L1612))
and
[here](b0e6d28782/compiler/semstmts.nim (L1646)).
Each time `prev` is `s.typ`, but the assertion expects `prev == nil`
which is false since `s.typ` is not nil the second time. To fix this,
the `prev == nil` part of the assertion is removed.

The reason this only happens for types like `seq[int]`, `(int, int)` etc
is because they don't have syms: `semTypeIdent` attempts to directly
[replace the typedesc param
itself](b0e6d28782/compiler/semtypes.nim (L1916))
with the sym of the base type of the resolved typedesc type if it
exists, which means `semTypeNode` doesn't receive the typedesc param sym
to perform the assert.

(cherry picked from commit 2a48182288)
2024-09-30 18:24:24 +02:00
..
2019-05-05 08:26:22 +02:00
2021-06-02 13:13:23 +02:00
2017-06-20 11:29:42 +02:00
2018-12-11 21:23:21 +01:00
2020-05-03 00:12:52 +02:00
2022-09-23 13:05:05 +02:00
2022-09-23 13:05:05 +02:00
2019-11-06 14:35:45 +01:00