Files
Nim/tests/metatype
ringabout b73908a361 fix #25789; improve handling of distinct types (#25791)
fix #25789

This pull request addresses an issue with the `distinctBase` trait in
the Nim compiler, ensuring it correctly handles types with generic
parameters and static parameters. Additionally, it adds a new test to
cover this scenario. The most important changes are:

### Compiler logic improvements

* Updated the `evalTypeTrait` implementation for the `distinctBase`
trait in `compiler/semmagic.nim` to properly skip all relevant type
wrappers, including those with generic and static parameters, when
unwrapping distinct types. This fixes incorrect handling of types like
`distinct L[int, 100]`.

### Test coverage

* Added a new test block for bug #25789 in
`tests/metatype/ttypetraits.nim` that defines a distinct type over a
generic type with a static parameter, verifies conversions, and checks
that the `distinctBase` trait returns the correct type.
2026-05-05 20:21:37 +02:00
..
2026-04-14 19:58:44 +02:00
2019-05-05 08:26:22 +02:00
2026-04-14 19:58:44 +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