Repository navigation
Typechecker cleanup: one helper for a record's fields at its type arguments; comments without audit-round tags - #148
Merged
Merged
Conversation
The block that substitutes a declared record's parameter variables with a use's type arguments, falling back to fresh variables on a wrong number of arguments, was written out four times beside the helper that does it (instantiate_record_fields_with_args): the field access in infer_expr and in the deferred field constraint, and the record update in infer_expr and in the deferred update. All four call the helper now. The deferred update (solve.rs) had no fallback: on a wrong number of arguments it returned the record's TEMPLATE fields, whose variables every use of the record shares, so the update could decide them for all. It takes fresh variables now, as the other three did. Nothing changes for someone writing silt: a wrong number of type arguments is reported where the type is written. A unit test locks the helper's two cases.
The "round NN" tags (GAP (round 35 F6), Round 74 Fix #2, BROKEN (round 93), LATENT (round 88), ...) and the other audit-history tags (GAP-2, BROKEN #1, T1 audit fix, Pre-fix ...) leave src/typechecker: 73 lines with a round number and 9 more tags. Each comment keeps what it explains, worded as what the code does now; a past behaviour stays only where it is the reason for the code ("would ..."). Two comments that cited a lock test that no longer exists (the round-83 STYLE lock) drop the citation. No code changes.
rendro
added this pull request to stack #154
October 24, 2026 05:11
rendro
marked this pull request as ready for review
October 24, 2026 12:02
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.
Lane E, PR 1 of 2 (wave 2). No visible change.
instantiate_record_fields_with_args: in inference.rs, field access and record update; in solve.rs, the field constraint and the update constraint. On an arity mismatch, the solve.rs update path returned the template fields; it now takes fresh variables like the others. A unit test locks the helper:record_fields_at_a_wrong_number_of_arguments_take_fresh_variables.Checks: whole suite, 2609/2609 passed; doc tests; clippy both ways; fmt; rustdoc -D warnings; no-default-features check.