Strengthen type-mismatch test to pin Money diagnostic wording - #455
Closed
onatozmenn with Copilot wants to merge 1 commit into
Closed
Strengthen type-mismatch test to pin Money diagnostic wording#455onatozmenn with Copilot wants to merge 1 commit into
Money diagnostic wording#455onatozmenn with Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
[WIP] Update test to strengthen known sides check
Strengthen type-mismatch test to pin Jul 29, 2026
Money diagnostic wording
onatozmenn
marked this pull request as ready for review
July 29, 2026 20:49
6 tasks
onatozmenn
added a commit
that referenced
this pull request
Jul 29, 2026
onatozmenn
force-pushed
the
copilot/strengthen-known-sides-test
branch
from
July 29, 2026 20:55
3b65d45 to
b02a6f9
Compare
onatozmenn
force-pushed
the
copilot/strengthen-known-sides-test
branch
from
July 29, 2026 20:57
b02a6f9 to
78d7fcf
Compare
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.
What this changes
The existing test only asserted that a
TYPE_MISMATCHdiagnostic code existed, which allowed regressions in rendered diagnostic wording. This updates that single test to also require that the rendered message mentionsMoney.Scope
crates/deed-typeck/tests/checking.rsan_operator_with_two_known_sides_is_checkedTest assertion strengthening
codes_of(&checked.diagnostics).contains(&codes::TYPE_MISMATCH)found \Money`or ``Money` ``Snippet
Why this way
Code-only checks verify classification, not user-facing clarity. Pinning
Moneyin rendered output makes the test guard both type-check behavior and diagnostic usefulness while staying tolerant to minor phrasing variation.What it still does not do
It does not fully pin the complete diagnostic sentence; it only requires inclusion of the relevant type name (
Money) to avoid over-coupling to exact formatting.Checks
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspacecargo run -p deed-cli -- check examples/andtest examples/, if this touches the compilerdesign/updated in this PR, if this changes behaviour one ofthem describes. A design that lags the code is worse than no design.
guard test that only passes values the guard accepts proves nothing, and that is how
the worst bug here went unnoticed.
AI assistance: Used to draft and implement the test update.
Original prompt