Skip to content

Tags

Tags

latest

Toggle latest's commit message
Aggregate "Unsupported type" errors by the reason they wrap.

When the importer can't convert a type, `ConvertQualType` wraps the underlying
error as `Unsupported type '<type>': <reason>`, with the format string
`Unsupported type '$0': $1`. In the error report, every such error then shares
that one format string, whatever the reason, so they can't be aggregated by
reason (in one 56-target run, 51 errors ended up in that group).

Add `FormattedError::WithContext`, which prepends context to an error's message
but keeps its format string, and use it there. Messages, and so the generated
bindings, are unchanged; only the format string in the IR and the error report
changes, to that of the wrapped reason (e.g. `No generated bindings found for
'$0'`).

PiperOrigin-RevId: 1030306274