Files
nushell/tests
Daniel Castrillon 8c790f0034 Fix RHS pipeline input type checking (issue #18682) (#18723)
## Description

`parse_math_expression` passed the pipeline input type when parsing the
left-hand side, but parsed the right-hand side without it.

As a result, an incompatible expression such as `"x" + $in` inside a
command with typed pipeline input was accepted by the parser and only
failed at runtime, while the equivalent `$in + "x"` expression produced
a parse-time type error.

This change passes the same pipeline input type to the right-hand side
and adds a regression test alongside the existing `$in` type-checking
tests.

## User-facing changes (Release notes)

Nushell now reports incompatible right-hand-side uses of `$in` in typed
math expressions during parsing, matching the existing behavior for the
left-hand side.

## Additional notes

Fixes #18682

Local verification:

- `cargo fmt --all -- --check`
- focused RHS pipeline input regression
- closure input-type isolation regressions
- block RHS pipeline input regression
- complete type-checking test module: 55 passed
- `nu-parser` tests: 302 passed, 2 ignored
- strict Clippy with default features

Signed-off-by: Daniel Castrillon <daniel.ca.pe207@gmail.com>
2026-07-25 08:02:26 -05:00
..
2026-04-02 15:25:22 +02:00