Repository navigation
Print private in type declarations of error messages - #8999
Conversation
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.
Diagnostic modified (privacy mismatch):
Example:
// Foo.resi
type t = int
// Foo.res
type t = private int
Before (diagnostic):
Type declarations do not match:
type t = int
is not included in
type t = int
After (diagnostic):
Type declarations do not match:
type t = private int
is not included in
type t = int
Diagnostic modified (a re-exported private variant):
Example:
// Priv.resi
type v = A | B
type w = v = private A | B
// Priv.res
type v = A | B
type w = A | B
Before (diagnostic):
is not included in
type w = v = A | B
After (diagnostic):
is not included in
type w = v = private A | B
Fixes: #8996
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMkrYaktctdKc4M41WF36t
Signed-off-by: Christoph Knittel <ck@cca.io>
Semantic Diff1 commit · Full page Print private in type declarations of error messages2a21564 · Christoph Knittel with Claude Opus 5.5 · Oct 23, 2026
Diagnostic modified (privacy mismatch) // Foo.resi
type t = int
// Foo.res
type t = private int
Type declarations do not match:
- type t = int
+ type t = private int
is not included in
type t = intDiagnostic modified (a re-exported private variant) // Priv.resi
type v = A | B
type w = v = private A | B
// Priv.res
type v = A | B
type w = A | B
is not included in
- type w = v = A | B
+ type w = v = private A | B |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8999 +/- ##
=======================================
Coverage 81.27% 81.27%
=======================================
Files 456 456
Lines 63828 63834 +6
=======================================
+ Hits 51875 51882 +7
+ Misses 11953 11952 -1
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8999 |
Fixes #8996.
The outcome printer, which prints type declarations in error messages, dropped
privatefrom abbreviations, variants and manifests; only records and open types kept it. So a privacy mismatch printed a declaration as included in itself, and a mismatch againsttype t = private ashowed a public alias:type t = private int(existing fixtureIface_privacy_mismatch)type t = int is not included in type t = inttype t = private int is not included in type t = inttype t = private atype t = atype t = private atype v = private A | Btype v = A | Btype v = private A | Btype w = v = private A | Btype w = v = A | Btype w = v = private A | Btype t = private {.."x": int}(existing fixtureobject_private_row_grants_set)type t = {.."x": int}type t = private {.."x": int}privatenow goes after the=of an abbreviation or variant, and after the manifest of a re-exported variant.New tests:
super_errors_multi/Cross_private_abbreviation_mismatchandCross_private_variant_manifest_mismatch.🤖 Generated with Claude Code
https://claude.ai/code/session_01CMkrYaktctdKc4M41WF36t