pub fn phase_messages_bundles(
parsed: &[ParsedFile],
groups: &BTreeMap<String, Vec<usize>>,
kinds: &BTreeMap<String, UnitKind>,
unit_uses: &HashMap<String, Vec<String>>,
errors: &mut ErrorSink,
)Expand description
message-bundles slice 1 (#859): messages-block legality, @reference
cardinality, within-block duplicate codes, and the uses bynk.locale
dependency. Runs here (not in phase_group) because it needs unit_uses,
resolved just above.
P5.0 (design/tracks/semantics-in-the-checker.md §6): relocated verbatim
from bynk-emit/src/project/validate.rs’s check_messages_bundles — one
of the two live editor-diagnostics regressions this slice closes (category
2 of analysis.rs’s own seven-category accounting). Cross-locale
completeness (bynk.messages.incomplete, only for codes present in the
reference locale but not this one — a locale-specific-only code is not an
error, per the “reference is a floor, not a ceiling” convention) and
cross-locale placeholder-set agreement (bynk.messages.placeholder_mismatch,
only for codes present in both — a missing code is incomplete’s job, not
this one’s). Two blocks declaring the same locale tag are rejected outright
(bynk.resolve.duplicate_message_locale, PR #875 review) — the emitter
has no dedup of its own, so a silent last-wins here would let a hard
tsc redeclare error (two colliding const __messages_<tag>
declarations) through instead.