Allow rest vars to have a custom name

This commit is contained in:
JT
2021-09-07 15:37:02 +12:00
parent 8f54ba10aa
commit bdce34676a
7 changed files with 77 additions and 16 deletions

View File

@@ -274,3 +274,8 @@ fn cell_path_var1() -> TestResult {
fn cell_path_var2() -> TestResult {
run_test("let x = [[lang, gems]; [nu, 100]]; $x.lang.0", "nu")
}
#[test]
fn custom_rest_var() -> TestResult {
run_test("def foo [...x] { $x.0 + $x.1 }; foo 10 80", "90")
}