Repository navigation
Check record labels once per record type - #8799
Conversation
|
@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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8799 +/- ##
=======================================
Coverage 80.58% 80.58%
=======================================
Files 447 447
Lines 61681 61689 +8
=======================================
+ Hits 49704 49712 +8
Misses 11977 11977
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
Codex Review: Didn't find any major issues. Swish! 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". |
Record expressions and patterns without a known type checked every field against all labels of each candidate record type, which is quadratic in the number of fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Christoph Knittel <ck@cca.io>
819a9a4 to
3296593
Compare
|
Developer playground preview: https://rescript-lang.github.io/rescript/dev-playground/?version=pr-8799 |
When the type of a record expression or pattern isn't known from context, the type checker narrows the candidate labels for each field using the record's other fields (
Typecore.disambiguate_label_by_ids). For every field and every candidate, it built a hash table of all the labels of the candidate's record type and looked up every field name in it. That is quadratic in the number of fields.Whether a candidate fits only depends on its record type (the
lbl_allarray its labels share), so the checks are now done once per record type for the whole expression or pattern.Record patterns still grow somewhat faster than linearly; the remaining cost is in the pattern-match checks, not in label disambiguation.
No generated output or error message changes.
🤖 Generated with Claude Code