-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Inconsistent error highlighting for type mismatches on binary operations #7289
Copy link
Copy link
Open
Labels
A:error-handlingHow errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)How errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)category:inconsistent-behaviorBehavior between different commands or types inconsistent/unexpectedBehavior between different commands or types inconsistent/unexpectedpolishthis problem makes nu feel unpolishedthis problem makes nu feel unpolishedstatus:needs-designthis feature requires designthis feature requires design
Description
Describe the bug
When trying to evaluate a binary addition with mismatched types, e.g.: int + string, the ordering of the types affects the preventative error highlighting.
Attempting to evaluate string + int highlights the +, whereas int + string highlights $var.
How to reproduce
nulet $val = 10let $var = "10"$val + $var$var + $val
Expected behavior
Both operations highlight the right most term, xor the operator.
Screenshots
Configuration
| key | value |
|---|---|
| version | 0.71.0 |
| branch | makepkg |
| commit_hash | 6cc4ef6 |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.65.0 (Arch Linux rust 1:1.65.0-1) |
| cargo_version | cargo 1.65.0 |
| pkg_version | 0.71.0 |
| build_time | 2022-11-09 06:34:03 +00:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins |
Additional context
No Response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A:error-handlingHow errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)How errors in externals/nu code are caught or handled programmatically (see also unhelpful-error)category:inconsistent-behaviorBehavior between different commands or types inconsistent/unexpectedBehavior between different commands or types inconsistent/unexpectedpolishthis problem makes nu feel unpolishedthis problem makes nu feel unpolishedstatus:needs-designthis feature requires designthis feature requires design
