fix: name the function and add a span to unknown-named-argument errors - #6142
Open
prql-bot wants to merge 1 commit into
Open
fix: name the function and add a span to unknown-named-argument errors#6142prql-bot wants to merge 1 commit into
prql-bot wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passing a named argument that no parameter matches produced an error with no span and a
Debug-printed ident. From the snapshot #6136 added yesterday:Two fixes, in
apply_args_to_closureand at its call site in the resolver:closure.as_debug_name()instead of{:?}onname_hint, matching the phrasing of the sibling arity error a few lines above (Too many arguments to function \not``).with_span_fallback, so the error renders with the usual ariadne caret instead of a bare one-liner.with_span_fallbackrather thanwith_span, so a span set deeper in the error isn't clobbered.Same input now reads:
bad_error_messages::not_with_named_arg— added in #6136, which flagged exactly this ("the message has no span andDebug-prints the ident") — moves toerror_messages::unknown_named_argwith updated snapshots, plus a third case (from x | take 1 b:2) so the coverage isn't allstd.not.Found during the nightly survey of
semantic/resolver/functions.rs.