A value of type D carried together with an annotation of type Info.
This is the reference's ('desc, 'info) annotated. The annotation is a typeparameter rather than a fixed Location because the type checker — whichwill be ported later — re-annotates the tree with inferred types.
AST snapshot tests are far more readable — and far less churn-prone — whenspans are hidden or abbreviated, but the differential harness needs the fullform. Rather than thread a formatting flag through every to_json, thereference's own tests set a process-wide knob; moonbitlang/parser does thesame in lexer/basic/config.mbt, and this follows suit.
The smallest span covering both operands. Both must come from the same file:a merge across files has no meaning, so it is a caller bug rather than acase to handle, and guard! says so.
A diagnostic, in the accumulate-don't-raise style moonbitlang/parser uses.
message is a plain String here rather than the reference's structuredMessage.t. That is deliberate for now: the front end only needs to render,not to restyle. When the type checker lands it will want the combinator form(so types can be coloured inside a sentence), at which point this fieldbecomes a Message — every other field stays as-is.
How serious a diagnostic is. Mirrors the reference's Diagnostic.severity.
Suggestion is never produced by the front end — it belongs to the typechecker's machine-applicable fixes — but it is declared here so thediagnostic renderers can be written once, against the complete set.
The position OCaml's Lexing.dummy_pos denotes, for synthesized nodes thathave no source span.
Note cnum is -1, not 0: the reference's output_error_no_source pathtests for exactly this to decide whether it can print a File "…", line …header at all, so the sentinel value has to match.
The active Location JSON style. Scope a change with show_loc.protectrather than assigning to it directly, so a failing test cannot leak thesetting into the next one.