mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:20:13 +01:00
Instead of always printing types as canonical, attempt to find a sugared type where possible, and include that type in the diagnostic. We can only do this when given the instruction whose type is being printed (`TypeOfInstId`) rather than the canonical type ID. Initial support here is intentionally minimal: just looking through calls to the callee's declared return type, and looking through pointer dereferences and corresponding pointer types, to build out the initial infrastructure. More cases can be added later; this degrades gracefully to using the canonical type if a better type can't be found. Assisted-by: Claude Opus 5 via Antigravity