To reproduce:
.foo(@a, @rest...) {
.bar(@a, @rest);
}
.bar(@a, @b: false) {}
.foo(@a, true); // works
.foo(@a); // Cannot read properties of undefined (reading 'value')
Current behavior:
Consuming an optional variadic that is not set causes an error.
Expected behavior:
Since (@a, @rest...) supports 1..N arguments, it should be expected that in the 1 case, @rest is unset, and if so, passing @rest should be valid and a no-op instead of an error.
Environment information:
less version: 4.4.0
nodejs version: v22.12.0
operating system: 6.6.87.2-microsoft-standard-WSL2