Files
Nim/tests/generics
metagn 128090c593 ignore uninstantiated static on match to base type [backport:2.0] (#23731)
fixes #23730

Since #23188 the compiler errors when matching a type variable to an
uninstantiated static value. However sometimes an uninstantiated static
value is given even when only a type match is being performed to the
base type of the static type, in the given issue this case is:

```nim
proc foo[T: SomeInteger](x: T): int = int(x)
proc bar(x: static int): array[foo(x), int] = discard
discard bar(123)
```

To deal with this issue we only error when matching against a type
variable constrained to `static`.

Not sure if the `q.typ.kind == tyGenericParam and
q.typ.genericConstraint == tyStatic` check is necessary, the code above
for deciding whether the variable becomes `skConst` doesn't use it.
2024-06-18 06:54:12 +02:00
..
2015-09-13 23:26:44 +02:00
2015-08-10 01:31:42 +02:00
2015-07-02 16:29:22 +02:00
2022-10-26 19:45:51 +08:00
2020-07-14 11:24:17 +02:00
2020-07-11 17:09:41 +02:00
2020-09-21 13:37:14 +02:00
2023-06-05 16:30:08 +08:00
2022-12-04 20:37:23 +01:00
2023-08-10 07:56:09 +02:00
2020-03-11 09:26:57 +01:00
2017-04-15 02:53:28 +03:00
2016-03-28 02:26:38 +02:00
2020-07-14 19:50:42 +02:00
2022-10-02 06:42:41 +02:00
2018-11-08 22:28:29 +01:00
2022-09-23 13:05:05 +02:00
2015-10-27 08:37:56 +01:00
2018-12-11 21:23:22 +01:00