-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Spread operator in a closure does not capture all arguments #12985
Copy link
Copy link
Closed
Labels
category:bugSomething isn't workingSomething isn't workingstatus:investigatethis requires investigationthis requires investigation
Milestone
Description
Describe the bug
The spread operator does not capture all residual arguments when used in a closure.
How to reproduce
$ do {|a, ...b| echo $a ...$b} 1 2 3 4
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 3 │
│ 2 │ 4 │
╰───┴───╯
Expected behavior
I expect the output to also include "2"
$ do {|a, ...b| echo $a ...$b} 1 2 3 4
╭───┬───╮
│ 0 │ 1 │
│ 1 │ 2 │
│ 2 │ 3 │
│ 3 │ 4 │
╰───┴───╯
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.93.0 |
| major | 0 |
| minor | 93 |
| patch | 0 |
| branch | |
| commit_hash | |
| build_os | windows-x86_64 |
| build_target | x86_64-pc-windows-msvc |
| rust_version | rustc 1.79.0-nightly (385fa9d84 2024-04-04) |
| rust_channel | nightly-x86_64-pc-windows-msvc |
| cargo_version | cargo 1.79.0-nightly (0637083df 2024-04-02) |
| build_time | 2024-05-25 21:19:07 -04:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | dataframe, default, sqlite, system-clipboard, trash, which |
| installed_plugins | polars |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category:bugSomething isn't workingSomething isn't workingstatus:investigatethis requires investigationthis requires investigation