Files
Nim/tests/misc
metagn 8b815cc857 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.

(cherry picked from commit e8092a5470)
2024-05-02 12:17:23 +02:00
..
2022-10-02 06:44:10 +02:00
2019-09-13 07:46:46 +02:00
2024-04-17 09:36:48 +02:00
2022-12-28 08:28:48 +01:00
2022-12-22 06:16:25 +01:00
2022-06-10 20:40:34 +02:00
2023-01-13 15:36:13 +01:00
2022-12-27 12:07:15 +01:00
2022-10-02 06:44:10 +02:00
2022-12-19 12:35:15 +01:00
2022-09-23 13:05:05 +02:00
2014-06-03 19:05:13 -04:00
2020-03-30 13:18:12 +02:00
2018-11-23 11:58:28 +01:00
2019-08-31 07:44:53 +02:00
2018-11-23 11:58:28 +01:00
2018-11-23 11:58:28 +01:00
2020-07-15 03:46:17 -04:00
2018-11-23 11:58:28 +01:00
2018-11-23 11:58:28 +01:00
2023-04-17 20:56:52 +02:00
2019-07-25 09:25:18 +02:00
2019-07-25 09:25:18 +02:00
2019-05-27 21:29:02 +02:00
2020-01-16 14:21:12 +01:00
2020-11-05 18:55:52 +01:00
2019-11-05 11:05:46 +01:00
2018-11-23 11:58:28 +01:00
2019-11-05 11:05:46 +01:00
2018-11-23 11:58:28 +01:00
2018-11-23 11:58:28 +01:00
2022-11-25 17:39:50 +08:00