summary refs log tree commit diff stats
path: root/compiler/semcall.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2024-08-22 08:19:43 +0300
committerGitHub <noreply@github.com>2024-08-22 07:19:43 +0200
commit2311049b27d6a46b6df53ecf4bbe73a598bedd65 (patch)
tree9f9ae687bbea305e685abddc61c900dc3ef1ee1d /compiler/semcall.nim
parent832ba815d1cf7ec0846cdade49f697228bb04d22 (diff)
downloadNim-2311049b27d6a46b6df53ecf4bbe73a598bedd65.tar.gz
don't require symbol with enum type to be constant in fitNode (#23999)
fixes #23998

In `fitNode` the first symbol of a symchoice that expects an enum type
with the same enum type is given as the result of the `fitNode`. But
`getConstExpr` is also called on it, which will return a `nil` node for
nodes that aren't constant but have the enum type, like variables or
proc parameters. Instead we just return the node directly since it's
already typed.

Normally, this `if` branch in `fitNode` shouldn't exist since
`paramTypesMatch` handles it, but the way pure enum symbols work makes
it really impractical to check their ambiguity, which `paramTypesMatch`
won't like. If it causes problems for regular enums we can restrict this
branch to just pure enums until they are hopefully eventually removed.
Diffstat (limited to 'compiler/semcall.nim')
0 files changed, 0 insertions, 0 deletions