Early exit from function with specific for loop construct using MinHeap #14042
Labels
Bug
This tag is applied to issues which reports bugs.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
V version: V 0.2.4 67e33bf.1be28c5
OS: EndeavourOS Linux
What did you do?
I wrote this for loop construct where I both check for the length of the queue & inspect the value of the
peek()
function.What did you expect to see?
The for loop should either return an error or properly set
t.v = 1
. In this specific case, the loop would have to loop zero times.What did you see instead?
The function exits at the point of the for loop, without returning an error. The result is that the final
println
call outputsshowing that the function didn't return an error, yet did not execute the final line which sets the value of
v.t
.If we replace the for loop with
the function does execute as expected, and the value of
t.v
is set to1
.The text was updated successfully, but these errors were encountered: