Skip to content

The typed-expression table's contract, and a count of unrecorded expressions (#767) - #3428

Merged
ehartford merged 1 commit into
mainfrom
typed-expr-contract
Nov 18, 2026
Merged

ehartford merged 1 commit into
mainfrom
typed-expr-contract

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #767.

The issue's two open asks:

  • (b) an audit comparing Sema's recorded types with the lowering's: audit:resolution judges every lowered expression, and since audit:all is clean on the compiler's own source, and the battery keeps it there (#3423) #3427 the battery runs it over the compiler's own source (self-audit).
  • (a) a stated contract for when an arm records: written where typed_expr_types is declared. A record is the node's own type; an adjustment has its own table; an arm records where it decides; a node with no record has its type derived by the lowering; wherever a record exists the lowered operand agrees.

Measured rather than assumed: about 162,000 lowered expressions in the compiler have no record (binary operators and identifiers mostly), so "record everything" is not the design. audit:resolution now notes that count by node kind.

No behaviour changes. Battery green on the branch tip.

…, and audit:resolution counts the lowered expressions that have no record, by node kind (#767)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typed_expr_types per-arm recording has no completeness or safety contract (6 gap instances; 1 unsafe insert)

1 participant