Repository navigation
Fix the const_switch_rejects_a_value_that_is_not_a_bool test on main - #19645
Merged
Merged
Conversation
nushell#19634 made the parser type `$r.a`, so it rejects `--chars=$r.a` before const evaluation runs, and nushell#19635 moved parse-time evaluation errors into ParseError::ParseTimeEval. Pass `($r | get a)`, which the parser types as any, so the test still covers the const evaluation check from nushell#19638, and match the CantConvert inside ParseTimeEval.
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.
Description
repl::test_engine::const_switch_rejects_a_value_that_is_not_a_boolfails on main (1dc849d), and so does every PR's root test job. #19638 added the test. Two PRs merged a few minutes before it changed what the test expects, and each of the three passed CI on its own base:cell-path-types, so the parser now knows$r.ainconst r = {a: 5}is anint. It rejects--chars=$r.awith a type mismatch and never evaluates the const.ParseError::LabeledErrorand into the newParseError::ParseTimeEval.The test covers the check #19638 added to const evaluation, so it needs an argument the parser can't type. It now passes
($r | get a).getreturnsany, so the parser lets it through and the const evaluation rejects it. The test matches theCantConvertinsideParseTimeEval, the same waybuiltin_switch_rejects_a_value_that_is_not_a_boolmatches its error.User-facing changes (Release notes)
Additional notes