-
Notifications
You must be signed in to change notification settings - Fork 2.1k
REPL panics when function has exactly 6 arguments #13930
Copy link
Copy link
Closed
Labels
A:parserIssues related to parsingIssues related to parsingdeprecated:duplicate(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issue(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issuepanic
Milestone
Description
Describe the bug
When trying to call a function with exactly 6 arguments at the REPL, Nu panics when typing the 4th argument.
How to reproduce
Define the following function:
def f [a b c d e f] { }Then, at the REPL, try calling it with the following parameters:
f 1 2 3Trying to write any character after 3 (note the space) will cause Nu to panic with the message:
Error: × Main thread panicked.
├─▶ at crates/nu-parser/src/parser.rs:926:28
╰─▶ index out of bounds: the len is 2 but the index is 3
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
The issue only occurs if f has exactly 6 parameters. The names and type signatures of the function and parameters don't seem to affect the outcome.
I've observed the issue on Nu v0.98.0, on both Linux and Android (Termux), and it occurs even with nu --no-config-file.
Expected behavior
I expect to be able to call the command as usual. For example, f 1 2 3 4 5 6.
Configuration
| key | value |
|---|---|
| version | 0.98.0 |
| major | 0 |
| minor | 98 |
| patch | 0 |
| branch | makepkg |
| commit_hash | 6e1e824 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.81.0 (eeb90cda1 2024-09-04) (Arch Linux rust 1:1.81.0-1) |
| cargo_version | cargo 1.81.0 (2dbb1af80 2024-08-20) |
| build_time | 2024-09-18 13:20:08 +00:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | default, sqlite, trash |
| installed_plugins |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:parserIssues related to parsingIssues related to parsingdeprecated:duplicate(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issue(deprecated: use GitHub's "close as duplicate" feature) This issue is a duplicate of another issuepanic