fixes #25008; Compiler internal error with static overload (#25234)

fixes #25008

It seems that `semOverloadedCall` evaluates the same node twice using
`tryConstExpr` in order for `efExplain` to print all the diagnostic
output. The problem is that `tryConstExpr` has side effects, i.e., it
changes the slot index of variables after VM execution.

(cherry picked from commit 130eac2f93)
This commit is contained in:
ringabout
2025-10-28 18:47:20 +08:00
committed by narimiran
parent 4eaecfe59e
commit 3bbba9e0ff
2 changed files with 21 additions and 0 deletions

View File

@@ -813,3 +813,9 @@ static:
conf = defaultConf # removing this results in the expected output
conf.val = 2
foo2323(defaultConf)
proc g1314(_: static bool) = discard
proc g1314(_: int) = discard
proc y1314() = g1314((; let k = 0; k))
y1314()