Skip to content

refactor(compiler): centralize settled-specialization invariants #92

Description

@thiremani

Context

PR #89 establishes the invariant FuncInfo.Settled => types, effects, direct callees, and a non-nil immutable CFG result are published. Several consumers enforce portions of that contract independently, with repeated cache lookup and ICE wording.

Proposed cleanup

  • centralize specialization cache lookup and settled-state validation in a small helper that adds caller/context information to ICEs
  • keep CFG presence validation even at call sites that currently consume only effects; it is part of the global publication invariant
  • consolidate repeated settled specialization has no CFG result checks without weakening staged publication
  • simplify thin graph/callee collector wrappers where doing so improves navigation
  • consider splitting the larger validateStatementEffect invariant switch into focused validators while keeping panics for impossible internal states

Constraints

  • no behavior or diagnostic-policy change
  • no defaulting missing published facts to empty values
  • preserve Settled as the single publication gate and keep graph/replay ordering deterministic

This is a low-priority readability/refactoring follow-up after PR #89.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions