Expand description
Collection of semantic problems into one report.
The generator stops on an ambiguity and does not guess. See the “Design
differences” section of the README. A spec with several independent problems
therefore costs one run for each problem. Diagnostics collects independent
problems, so one run reports all of them.
Two rules keep this report useful.
- The collector holds independent problems only. Some checks produce a result
that the rest of the lowering pass needs. An unresolved
$refis one example. Such a check must still return at once. A run that continues past it reports later problems that are only effects of the first one. - One problem is reported as itself.
Diagnostics::into_resultreturns the singleErrorunchanged. It builds anError::Validationfor two or more problems only. A caller that matches one variant still works, and the message for one problem carries no count.
Structs§
- Diagnostics
- A collector of independent semantic problems. One run reports every problem that it finds and does not stop at the first one.