Skip to content

Arguments passed incorrectly to recursively called functions

Created by: xTibor

Reproduction:

fn recursive a b c d
    echo $a $b $c $d
    sleep 1
    recursive $d $a $b $c
end

recursive 1 2 3 4

Expected behavior:

1 2 3 4
4 1 2 3
3 4 1 2
2 3 4 1
1 2 3 4
...

Actual behavior:

1 2 3 4
4 4 4 4
4 4 4 4
4 4 4 4
4 4 4 4
...

Build information: rustc -V: rustc 1.28.0-nightly (952f344cd 2018-05-18) git rev-parse HEAD: 017d8075 System: KDE neon 5.12 (Ubuntu 16.04)