Repository navigation
A used child's refusal is reported once - #2477
Merged
Merged
Conversation
When the root uses a child component, check_all reads the expanded root, where the child's declarations are lifted and renamed name#<hash>. Several analysis diagnostics took their names from there without contract_syntax::inline::calls::shown, so the author saw `m#ac4664e4...5d74`, and analyze-send-twice even suggested writing `mutation m#... queue`, which is not Contract. analyze-send-twice, analyze-send-assigned, analyze-then-self-send, analyze-task-gate-clock, analyze-sequence-clock and analyze-change-cycle now pass their names through shown().
check_mutation_then and sends::check ran on the expanded root and again on each authored child, so one mistake in a used child (handler arity, send twice, then self send) was refused twice at the same span; cli/tests/it/mutation.rs a_send_twice_is_found_through_a_tail_call_once shows the intended once. check_all now keeps the first error for each (id, span), as sends::check already does within itself.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
# Conflicts: # contract/analyze/src/lib.rs
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.
Stacked on #2476 (the lifted names PR): it adds to the same test module in
contract/analyze/src/lib.rs, and without it the copy kept for send twice and then self send is the root's, which prints the hashed name. Only the last commit here is new.In
check_all,check_mutation_thenandsends::checkrun on the expanded root (ci == 0) and then again on each authored child, so one mistake in a used child produces two identical refusals at one span, and the CLI prints both.cli/tests/it/mutation.rs'sa_send_twice_is_found_through_a_tail_call_onceshows the intended behaviour is once.analyze-handler-arity(7:30,aftertakes 1 parameter)analyze-send-twiceanalyze-then-self-sendFix: at the end of
check_all, keep only the first error for each(id, span)(4 lines), assends::checkalready de-duplicates by span within itself.Test:
lifted_child_tests::a_used_childs_refusal_is_reported_once(the three diagnostics), failing without the fix.cargo test -p contract-analyze -p contract-checking, the related CLIitgroups (queue, calls, match_guards, diagnostics, mutation, child_state_lifetime, recovery), clippy with-D warnings, fmt andscripts/caps.mjspass.