Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## instanceof-typeof-annotations #8949 +/- ##
=================================================================
+ Coverage 81.19% 81.22% +0.02%
=================================================================
Files 457 457
Lines 64027 63987 -40
=================================================================
- Hits 51987 51973 -14
+ Misses 12040 12014 -26
🚀 New features to boost your workflow:
|
3aafb3f to
c7381a1
Compare
|
@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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7381a1e6c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
7a1118f to
b786fd3
Compare
b786fd3 to
526b304
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! 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". |
Why:
With the stdlib annotated, the classifier's list of stdlib type names
only matched types that happen to be printed like a stdlib type, and
its name-based dict check took any type named `dict` for an object.
The list, matched before and after expansion, is gone, and so is the dict
check: a payload is recognized by its `@instanceOf` or `@typeOf`, or by the
builtin type it expands to. Generated code is unchanged for the stdlib's
types.
Diagnostic added (a local type named dict):
Example:
type dict<'a>
@unboxed type t = D(dict<int>) | S(string)
Before (js): if (typeof v === "object") { return "D"; } else { return "S"; }
After (diagnostic):
This untagged variant definition is invalid: Case D has a payload that is not of one of the recognized shapes (object, array, etc). Then it must be the only case with payloads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fc7LEuyEfynjaKCVEBPmTF
Signed-off-by: Christoph Knittel <ck@cca.io>
Why:
The classifier used to recognize payloads by the printed path of their
type; nothing pinned that it no longer does.
An unannotated local `Stdlib_Date.t`, which the removed list would have
taken for a date, is an unknown payload, and aliases of builtin types are
recognized through their expansion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fc7LEuyEfynjaKCVEBPmTF
Signed-off-by: Christoph Knittel <ck@cca.io>
Why:
Payloads are now recognized only by annotations and builtin types, so
the spec's list of stdlib type names and the fallback to it are gone.
Rule 4 lists `promise<_>` as the one builtin class and says that a type is
never recognized by its name; rule 5 keeps the stdlib's annotations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fc7LEuyEfynjaKCVEBPmTF
Signed-off-by: Christoph Knittel <ck@cca.io>
526b304 to
7d2fd82
Compare
Semantic Diff3 commits · Full page Recognize untagged payloads only by annotations and builtin types237d5bf · Christoph Knittel with Claude Opus 5.5 · Oct 21, 2026
The list, matched before and after expansion, is gone, and so is the dict check: a payload is recognized by its Diagnostic added (a local type named dict) type dict<'a>
@unboxed type t = D(dict<int>) | S(string)
if (typeof v === "object") { return "D"; } else { return "S"; }
Test that payloads are not recognized by type name0a2f6d5 · Christoph Knittel with Claude Opus 5.5 · Oct 21, 2026
An unannotated local Drop the name list from the untagged variants spec7d2fd82 · Christoph Knittel with Claude Opus 5.5 · Oct 22, 2026
Rule 4 lists |
Stacked on #8950, which declares and annotates the stdlib's runtime classes.
Now that the stdlib's classes declare themselves, untagged variant payloads are recognized only by
@instanceOf/@typeOfor by the builtin type they expand to:string,int,float,bigint,bool,dict,array, tuples,promiseand functions. These have no declaration to annotate. Removed:type_to_instanceof_backed_objand its list of 21 stdlib type names, which the classifier consulted both before and after expanding a type.type_is_builtin_objectwith its"Stdlib.Dict.t"/"Stdlib_Dict.t"name checks. The classifier expands the type to the builtindict, and inTypeoptit was redundant next totype_cannot_contain_undefined, which already knowsdict.Generated code is unchanged across all test projects.
The next step, as discussed, is moving
FileandBlobout of the stdlib to WebAPI, which can now declare them the same way.🤖 Generated with Claude Code
https://claude.ai/code/session_01Fc7LEuyEfynjaKCVEBPmTF