Repository navigation
docs(jq): record map_values(first)'s path-error message residual and pin it (#3884) - #3907
Conversation
…pin it (#3884) The fold-source and plain path routes of map_values(first) evaluate the body by value, so jq's type error wins over its path error on a scalar element and the path error names the produced container, not the indexed element. Stdout and exit code match; add the oracle rows to limitations.md and pin the messages.
CoverageTotal: 94.97% ⚪ 0.04 pp vs Comparing No per-file coverage changes vs ℹ️ 1 unchanged file(s) also moved (not attributed to this PR)These files were not modified by this diff; the shift is either measurement variance between the two runs or a cross-file effect (e.g. a removed test).
🔇 0 ignored region(s), 382 tolerated region(s)
Excluded by ignore-filename-regex: 1 file (none of them touched by this diff). Patch coverageNo new executable lines added by this diff. 📦 Full per-file coverage summary · run summary Baseline: the report published for |
CoverageTotal: 94.89% ⚪ 0 pp vs Comparing No per-file coverage changes vs 🔇 0 ignored region(s), 383 tolerated region(s)
Excluded by ignore-filename-regex: 1 file (none of them touched by this diff). Patch coverageNo new executable lines added by this diff. |
Summary
Fixes #3884. The issue asks to confirm the
map_values(first)fold-source route is covered by the #3271 residual record, or to align the wording. Probing it shows the divergence is the by-value ordering tradeoff of #3271, not a fold-source quirk: it is identical for plainpath(map_values(first)).near attempt to access element 0 of 1); this resolver evaluates the body by value and raises jq's type error (Cannot index number with number).element 0 of {"a":1,"b":null}), not the elementfirstindexed ([1]in jq).Naming the element would need the resolver to run the
map_valuesbody in path mode per element, which is the broader #3271/#2743 design the limitations record already declines, so this records the residual (both the type-error ordering and the container naming, as a path and as a fold source) indocs/compliance/jq/limitations.mdand pins the messages withtest_map_values_first_path_error_message_residual_3884. No behaviour change.Test plan
cargo test --features cli,simd,regex,serde(all passing)cargo clippy --all-targets --all-features -- -D warningscargo clippy --all-targets --features std,simd,serde,cli,regex,bench-runner,large-tests,mmap-tests -- -D warningscargo fmt --check/usr/bin/jq1.7.1 (jq's own messages are in the test comments)