Semantic Diff

#8999 Print private in type declarations of error messages

1 commit

c9a267c4bfab2a17d26bb4c1036266704e351435..pr-8999

2a2156422 · Christoph Knittel with Claude Opus 5.5 · Oct 23, 2026

Print private in type declarations of error messages

Why

The outcome printer dropped private from abbreviations, variants and manifests, so a privacy mismatch read "type t = int is not included in type t = int", and a mismatch against type t = private a showed a public alias (#8996).

private is printed after the = of an abbreviation or a variant, and after the manifest of a re-exported variant, as records and open types already did.

modifiedDiagnostic privacy mismatch

// Foo.resitype t = int// Foo.restype t = private int
diagnostic
Before
After
Type declarations do not match:Type declarations do not match: type t = int type t = private intis not included inis not included in type t = int type t = int

modifiedDiagnostic a re-exported private variant

// Priv.resitype v = A | Btype w = v = private A | B// Priv.restype v = A | Btype w = A | B
diagnostic
Before
After
is not included inis not included in type w = v = A | B type w = v = private A | B