Semantic Diff

#9380 Fold the outcome printer into typing and drop the startup hooks

1 commit

dc052b45d83828b6d0b716357c83947893760b76..pr-9380

dffeec9b3 · cknitt + Claude · Nov 22, 2026, 07:23 UTC

Fold the outcome printer into typing and drop the startup hooks

The type checker printed types and signatures through Oprint, four refs that failed until Res_outcome_printer.setup filled them, and called the ReScript pattern printer, the polymorphic variant printer and the polymorphic variant match compiler through refs that Bs_conditional_initial set at startup. The hooks existed because those modules sat in libraries above the type checker. Now that typing links the printer library, they can be called directly:

- Res_outcome_printer moves from outcome_printer into typing, and Printtyp calls it. Oprint, Res_outcome_printer.setup and the outcome_printer library are gone. - Parmatch calls Pattern_printer, Printtyp calls Res_printer.polyvar_ident_to_string, and Matching calls Polyvar_pattern_match. Matching's unused default implementations, its as_interval and Switch.test_sequence, which only they used, are removed. - Ctype.variant_is_subtype is a function instead of a ref filled with Matching_polyfill.variant_is_subtype. Its body moves into Ctype, checking the base type with Ctype's own helpers, since Typeopt depends on Ctype; get_unboxed_type_representation moves up, unchanged, to precede it. - Bs_conditional_initial keeps the hooks that can't be direct calls (the .cmi loader and the build file store, which tests replace) and moves into typing.

Output is unchanged.