-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Parser incorrectly infers type of table column with multiple different types #16421
Copy link
Copy link
Closed
Closed
Copy link
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 working
Milestone
Description
Describe the bug
If you have a table with a column that has at least 3 different inner types, the parser will incorrectly infer the column type as the type of the last value, rather than any. This can be most easily demonstrated by adding a type hint which is obviously incorrect, and seeing how the parser reports the inferred type:
This issue blocks #16079 from being merged
How to reproduce
let expected: nothing = [[item];
[123],
[false],
["hi"]
]Expected behavior
The type should be inferred as table<item: any>
Configuration
| key | value |
|---|---|
| version | 0.106.2-nightly.13 |
| major | 0 |
| minor | 106 |
| patch | 2 |
| pre | nightly.13 |
| branch | nightly |
| commit_hash | fdda188e6a8f9cbe96dcb1aeeda34861ee6276d4 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.86.0 (05f9846f8 2025-03-31) |
| rust_channel | 1.86.0-x86_64-unknown-linux-gnu |
| cargo_version | cargo 1.86.0 (adf9b6ad1 2025-02-28) |
| build_time | 2025-08-12 02:27:49 +00:00 |
| build_rust_channel | release |
| allocator | standard |
| features | default, plugin, rustls-tls, sqlite, static-link-openssl, trash-support |
| installed_plugins | custom_values 0.1.0, example 0.105.2, explore_ir 0.6.0, formats 0.105.2, gstat 0.105.2, inc 0.105.2, polars 0.101.1, query 0.105.2, stress_internals 0.105.2 |
| experimental_options | example=false, reorder-cell-paths=true |
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 working