Files
Nim/tests/generics
metagn 31ee75f10e bypass constraints for tyFromExpr in generic bodies (#23863)
fixes #19819, fixes #23339

Since #22029 `tyFromExpr` does not match anything in overloading, so
generic bodies can know which call expressions to delay until the type
can be evaluated. However generic type invocations also run overloading
to check for generic constraints even in generic bodies. To prevent them
from failing early from the overload not matching, pretend that
`tyFromExpr` matches. This mirrors the behavior of the compiler in more
basic cases like:

```nim
type
  Foo[T: int] = object
    x: T
  Bar[T] = object
    y: Foo[T]
```

Unfortunately this case doesn't respect the constraint (#21181, some
other bugs) but `tyFromExpr` should easily use the same principle when
it does.
2024-07-20 09:02:08 +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