-
Notifications
You must be signed in to change notification settings - Fork 2.1k
nushell 0.86 regression: command option type and value is incorrectly inferred from default value #11033
Copy link
Copy link
Closed
Labels
A:parserIssues related to parsingIssues related to parsingA:type-systemProblems or features related to nushell's type systemProblems or features related to nushell's type systemcategory:bugSomething isn't workingSomething isn't workingcategory:regressionSomething that worked does not work anymore.Something that worked does not work anymore.
Milestone
Description
Describe the bug
In the following tests, explicitly typing an int option (--age) causes the next option (--name) to default to false instead of "foobar":
#[test]
def test-cmd1 [] {
assert equal (cmd1) "foobar" # PASS
}
def cmd1 [
--age = 0
--name = "foobar"
] {
$name # "foobar"
}
#[test]
def test-cmd2 [] {
assert equal (cmd2) "foobar" # FAIL
}
def cmd2 [
--age: int = 0
--name = "foobar"
] {
$name # false
}
#[test]
def test-cmd3 [] {
assert equal (cmd3) "foobar" # FAIL
}
def cmd3 [
--age: int
--name = "foobar"
] {
$name # false
}How to reproduce
Run the above tests.
Expected behavior
The above tests should pass.
Screenshots
No response
Configuration
| key | value |
|---|---|
| version | 0.86.0 |
| branch | makepkg |
| commit_hash | 5d8763e |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.73.0 (cc66ad468 2023-10-03) (Arch Linux rust 1:1.73.0-1) |
| cargo_version | cargo 1.73.0 |
| build_time | 2023-10-18 08:45:09 +00:00 |
| build_rust_channel | release |
| allocator | mimalloc |
| features | dataframe, default, extra, sqlite, trash, which, zip |
| installed_plugins |
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:parserIssues related to parsingIssues related to parsingA:type-systemProblems or features related to nushell's type systemProblems or features related to nushell's type systemcategory:bugSomething isn't workingSomething isn't workingcategory:regressionSomething that worked does not work anymore.Something that worked does not work anymore.