Files
Nim/compiler
metagn e8092a5470 delay resolved procvar check for proc params + acknowledge unresolved statics (#23188)
fixes #23186

As explained in #23186, generics can transform `genericProc[int]` into a
call `` `[]`(genericProc, int) `` which causes a problem when
`genericProc` is resemmed, since it is not a resolved generic proc. `[]`
needs unresolved generic procs since `mArrGet` also handles explicit
generic instantiations, so delay the resolved generic proc check to
`semFinishOperands` which is intentionally not called for `mArrGet`.

The root issue for
[t6137](https://github.com/nim-lang/Nim/blob/devel/tests/generics/t6137.nim)
is also fixed (because this change breaks it otherwise), the compiler
doesn't consider the possibility that an assigned generic param can be
an unresolved static value (note the line `if t.kind == tyStatic: s.ast
= t.n` below the change in sigmatch), now it properly errors that it
couldn't instantiate it as it would for a type param. ~~The change in
semtypinst is just for symmetry with the code above it which also gives
a `cannot instantiate` error, it may or may not be necessary/correct.~~
Now removed, I don't think it was correct.

Still possible that this has unintended consequences.
2024-01-11 07:45:11 +01:00
..
2023-12-13 10:29:58 +01:00
2023-12-15 10:20:57 +01:00
2023-12-13 10:29:58 +01:00
2023-12-17 18:43:52 +01:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2023-12-25 07:12:54 +01:00
2022-09-27 10:57:47 +02:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2023-12-13 10:29:58 +01:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2017-01-07 22:35:09 +01:00
2023-12-15 10:20:57 +01:00
2023-12-17 18:43:52 +01:00
2023-12-15 10:20:57 +01:00
2023-12-13 10:29:58 +01:00
2023-11-04 17:46:59 +08:00
2021-01-12 09:36:51 +01:00
2023-12-06 18:17:57 +01:00
2022-03-23 20:34:53 +01:00
2023-12-17 18:43:52 +01:00
2023-12-25 07:12:54 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2023-12-17 18:43:52 +01:00
2023-12-17 18:43:52 +01:00
2023-12-13 10:29:58 +01:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2023-12-13 10:29:58 +01:00
2023-12-17 18:43:52 +01:00
2023-12-02 05:28:24 +01:00
2023-12-12 16:54:50 +01:00
2023-12-17 18:43:52 +01:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2023-12-15 10:20:57 +01:00
2023-12-17 18:43:52 +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.