Skip to content

Source range for pipe value used as unlabelled arg #6787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2025
Merged

Source range for pipe value used as unlabelled arg #6787

merged 1 commit into from
May 11, 2025

Conversation

nrc
Copy link
Contributor

@nrc nrc commented May 8, 2025

Fixes #6613

Extracted from #6644 to just fix the source range without touching the kwarg shorthand (left for post 1.0).

@nrc nrc requested review from jtran and adamchalmers May 8, 2025 21:45
Copy link

qa-wolf bot commented May 8, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 11, 2025 5:13am

Copy link

codspeed-hq bot commented May 8, 2025

CodSpeed Instrumentation Performance Report

Merging #6787 will not alter performance

Comparing nrc-pipe-fix (db3f97e) with main (f73831a)

Summary

✅ 54 untouched benchmarks

Copy link
Contributor

@jtran jtran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One suggestion, if you like.

.clone()
.map(|val| Arg::new(val, pipe_value_source_range));
let Some(unlabeled) = args.unlabeled.take().or(default_unlabeled) else {
let unlabelled = args.kw_args.unlabeled.take().or_else(|| args.pipe_value.take());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have Args::unlabeled_kw_arg_unconverted() that computes the unlabeled arg from all its possible inputs. To reduce duplication, or at least keep it together, could we maybe make another flavored function over there in Args that takes ownership, instead of reaching into it from here?

Signed-off-by: Nick Cameron <nrc@ncameron.org>
@nrc nrc merged commit f36b69f into main May 11, 2025
69 of 70 checks passed
@nrc nrc deleted the nrc-pipe-fix branch May 11, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KCL: Custom functions don't default their @ param to %
3 participants