diff options
author | metagn <metagngn@gmail.com> | 2024-09-27 12:09:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 11:09:49 +0200 |
commit | 56a3dd57fb038cab2d00f6415435e701d2273573 (patch) | |
tree | b43720821f7131f85bc16dff14eb1ceb35f9200a /tests/lent/tnot_allowed_lent2.nim | |
parent | 7cccf36d7b83733aa45a2962aa1541c6a1e89e77 (diff) | |
download | Nim-56a3dd57fb038cab2d00f6415435e701d2273573.tar.gz |
evaluate all hidden conversions in case branches (#24187)
fixes #11422, refs #8336/#8333, refs #20130 The compiler generates conversion nodes *after* evaluating the branches of case statements as constants, the reasoning is that case branches accept constants of different types, like arrays or sets. But this means that conversion nodes that need to be evaluated like converter calls don't get evaluated as a constant for codegen. #8336 fixed this by re-evaluating the node if an `nkHiddenCallConv` was created, and in #20130 this logic also had to be added for `nkHiddenStdConv` for cstrings. This logic was only for single case elements, it has now been added to range elements as well to fix #11422. Additionally, all conversion nodes are now evaluated for simplicity, but maybe this won't pass CI.
Diffstat (limited to 'tests/lent/tnot_allowed_lent2.nim')
0 files changed, 0 insertions, 0 deletions