nushell/crates/nu-command/src
Devyn Cairns 0b8d0bcd7a
Fix order of I/O types in take until (#13356)
# Description
Just a quick one, but `List(Any)` has to come before `Table`, because
`List(Any)` is a valid match for `Table`, so it will choose `Table`
output even if the input was actually `List(Any)`. I ended up removing
`Table` because it's just not needed at all anyway.

Though, I'm not really totally sure this is correct - I think the parser
should probably actually just have some idea of what the more specific
type is, and choose the most specific type match, rather than just doing
it in order. I guess this will result in the output just always being
`List(Any)` for now. Still better than a bad typecheck error

# User-Facing Changes

Fixes the following contrived example:

```nushell
def foo []: nothing -> list<int> {
  seq 1 10 | # list<int>
    each { |n| $n * 20 } | # this causes the type to become list<any>
    take until { |x| $x < 10 } } # table is first, so now this is type table
    # ...but table is not compatible with list<int>
}
```

# After Submitting
- [ ] make typechecker type choice more robust
- [ ] release notes
2024-07-12 10:25:44 +02:00
..
bytes Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
charting Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00
conversions Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
database Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
date Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
debug Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
env Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
experimental Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
filesystem Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
filters Fix order of I/O types in take until (#13356) 2024-07-12 10:25:44 +02:00
formats Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
generators Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
hash Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
help Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
math Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
misc Revert "Span ID Refactor (Step 2): Make Call SpanId-friendly (#13268)" (#13292) 2024-07-04 00:02:13 +03:00
network Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
path Path migration 1 (#13309) 2024-07-09 17:25:23 +08:00
platform Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
random Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
removed Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
shells Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
stor Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
strings Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
system Path migration part 2: nu-test-support (#13329) 2024-07-12 02:43:10 +00:00
viewers Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
default_context.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
example_test.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
lib.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00