A read guard for a field whose subclass declaration narrows the inherited
one. The two declarations share one storage slot, so a write that goes
through the parent’s — an inherited method, a parent-typed reference, the
parent’s constructor — can leave the slot holding a value the subclass’s
declaration does not admit. The language accepts the narrowing anyway
(spec.md §Classes, matching TypeScript), so the read is what has to check.
ty is the binding’s class type — the root Error class for untyped
catch (e), or the annotated Error subclass (which filters at runtime);
boxed mirrors Let.boxed from the Capture pass.
A typechecked class. Method/constructor bodies are checked in the class-body
pass; codegen (SUB-480+) consumes the field layout, body IDs, and signatures.
What a redeclared field’s read guard verifies before it casts. The
typechecker selects the most precise test codegen can lower, falling back to
a read-time substituted test for erased class parameters.
The structural type an object literal of type ty is built with. Its fields
come from fields, which hold the undefined-filled optional fields and the
declared field types a literal’s own type can leave out or narrow. A type
with an index signature (from a spread) is already the layout.