### Describe the bug When a boolean value is passed to a function which expects an int, "expected non-boolean value" is thrown instead of a more concrete "expected int". ### How to reproduce ```nushell ~> def test [--ports: list<int>] {} ~> test ~> test --ports [1 2 3] ~> test --ports [1 2 "true"] Error: nu::parser::parse_mismatch × Parse mismatch during operation. ╭─[entry #26:1:19] 1 │ test --ports [1 2 "true"] · ───┬── · ╰── expected int ╰──── ~> test --ports [1 2 true] Error: nu::parser::parse_mismatch × Parse mismatch during operation. ╭─[entry #27:1:19] 1 │ test --ports [1 2 true] · ──┬─ · ╰── expected non-boolean value ╰──── ``` ### Expected behavior "expected int" error in both cases. ### Configuration | key | value | | -------------------- | -------------------------------------------------- | | version | 0.106.1 | | major | 0 | | minor | 106 | | patch | 1 | | branch | | | commit_hash | 682d593d3f53e5337dceedf98c9603a698af6a64 | | build_os | linux-x86_64 | | build_target | x86_64-unknown-linux-musl | | rust_version | rustc 1.86.0 (05f9846f8 2025-03-31) | | rust_channel | 1.86.0-x86_64-unknown-linux-musl | | cargo_version | cargo 1.86.0 (adf9b6ad1 2025-02-28) | | build_time | 2025-08-03 12:10:49 +03:00 | | build_rust_channel | release | | allocator | standard | | features | default, plugin, rustls-tls, sqlite, trash-support | | installed_plugins | template 0.105.1 | | experimental_options | example=false, reorder-cell-paths=false |
Activity
fdncred commentedon Aug 11, 2025
For anyone looking to change this, it looks like the non-boolean error is coming from here:
nushell/crates/nu-parser/src/parser.rs
Lines 5190 to 5215 in c4fcd54
[parser] Improve type errors for boolean literals (#16408)